Skip to content

Instantly share code, notes, and snippets.

@Topener
Created March 29, 2018 14:14
Show Gist options
  • Save Topener/8723486a78acf41568353f4852ff3a7b to your computer and use it in GitHub Desktop.
Save Topener/8723486a78acf41568353f4852ff3a7b to your computer and use it in GitHub Desktop.
simple demo of how to use dynamic filter
var searchQuery = '';
function filter(collection){
var models = [];
_.each(collection.models, function(m){
if (m.attributes.title.indexOf(searchQuery) > -1){
models.push(m);
}
});
return models;
}
setTimeout(function(){
searchQuery = 'test';
myDataFunction();
},10000);
<TableSection dataFilter="filter" dataFunction="myDataFunction" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment