Skip to content

Instantly share code, notes, and snippets.

@anthonychung
Last active December 18, 2015 03:39
Show Gist options
  • Save anthonychung/5719654 to your computer and use it in GitHub Desktop.
Save anthonychung/5719654 to your computer and use it in GitHub Desktop.
#tiAlloy shuffle and update collection with view-binding. Need to use reset.
function callback(){
//Alloy.Collections.collectionName.shuffle();
// just using suffle wont update the binding, I have to reset, then call trigger change.
Alloy.Collections.collectionName.reset(Alloy.Collections.collectionName.shuffle());
Alloy.Collections.collectionName.trigger('change');
$.myTable.height=Ti.UI.SIZE;
}
<TableView id="myTable" dataCollection="Alloy.Collections.collectionName">
<TableViewRow >
<Label text="{title}"/>
</TableViewRow>
</TableView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment