Created
March 29, 2018 14:14
-
-
Save Topener/8723486a78acf41568353f4852ff3a7b to your computer and use it in GitHub Desktop.
simple demo of how to use dynamic filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TableSection dataFilter="filter" dataFunction="myDataFunction" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment