Skip to content

Instantly share code, notes, and snippets.

@NamTThai
Last active December 9, 2015 21:26
Show Gist options
  • Save NamTThai/0552dc176d95f2d32bc9 to your computer and use it in GitHub Desktop.
Save NamTThai/0552dc176d95f2d32bc9 to your computer and use it in GitHub Desktop.
eFilter: function(item) {
var valid = true;
// this.filters is an Object that holds existing filters in all columns.
// Key is column name, value is filter value
// For example: {Dessert: "Cake", Calorie: /^\d{3}$/g}; Calorie filter is a regex indicating that number needs to have 3 digits
// This filter means to show only rows that have Cake in its Dessert column and 3 digits Calorie value
for (var headerName in this.filters) {
valid = valid && this.eFilterCustom(headerName, this.filters[headerName], item);
}
return valid;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment