ekokotov / object-table

Angular directive to easy create dynamic tables from source or URL with sorting, filtering and pagination. Smart templates and good perfomance
BSD 3-Clause "New" or "Revised" License
171 stars 52 forks source link

Custom Search based on multiple words #13

Closed ajitdixit closed 9 years ago

ajitdixit commented 9 years ago

Can we have search on multiple words seperated by space something similar to following function from advanced angular grid

TestNameFilter.prototype.doesFilterPass = function (node) { var filterText = this.$scope.filterText; if (!filterText) { return true; } // make sure each word passes separately, ie search for firstname, lastname var passed = true; filterText.toLowerCase().split(" ").forEach(function(filterWord) { if (node.value.toString().toLowerCase().indexOf(filterWord)<0) { passed = false; } }); return passed; };

ekokotov commented 9 years ago

Yes. Just describe your filter and add as additional filter (add-filter attribute) like here: http://ekokotov.github.io/object-table/samples.html#/additional_filters