Guest User

Untitled

a guest
Dec 10th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. var pre = '';
  2. for(var i = 0, j = dataArray.length; i < j; i++) {
  3. if(dataArray[i].section != pre)
  4. //it's a header
  5. tableData[i] = Ti.UI.createTableViewSection({headerTitle:dataArray[i].section})
  6. pre = dataArray[i];
  7. //it's a row
  8. tableData[i].add(Ti.UI.createTableViewRow({title:dataArray[i].title}));
  9. }
  10.  
  11. // this works for separating my rows and headers, but not grouping duplicate headers...
Add Comment
Please, Sign In to add comment