Skip to content

Commit

Permalink
Add filterByColumn method
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlanciaux committed Mar 12, 2016
1 parent c500220 commit 74be928
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/griddle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ var Griddle = React.createClass({
return false;
});
},

filterByColumn: function(results, filter, column) {
return _filter(results,
function(item) {
if ((deep.getAt(item, column)||"").toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) {
return true;
}

return false;
}
)
},

/* if we have a filter display the max page and results accordingly */
setFilter: function(filter) {
if(this.props.useExternal) {
Expand Down

0 comments on commit 74be928

Please sign in to comment.