Skip to content

Instantly share code, notes, and snippets.

@reymundolopez
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save reymundolopez/9101023 to your computer and use it in GitHub Desktop.

Select an option

Save reymundolopez/9101023 to your computer and use it in GitHub Desktop.
Create a new backbone filtered collection in Titanium Alloy
var originalCollection = Alloy.Collections.myCollection;
var filtered = filterCollection();
filterCollection() {
originalCollection.fetch();
return new Alloy.createCollection("myCollection", originalCollection.filter(function(m){
return m.get("someProperty") === "someValue";
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment