lorenzofox3/Smart-Table — pull request #221 by Almar (2014-11-15 01:07:15+00:00)
Title: Make plugin filters posible

I would like to be able to filter the data in a table in more ways than just 'contains', like st-search does. Further more I would like to be able to filter different columns with different filter behaviors. For instance a column with a standard search, then a column with a date picker (or date range selector) and then a column with a select box that needs a strict comparison filter.

With this PR I would like to suggest a way to make filter plugins possible. Lets say I would like to make my own version of st-search that does a strict comparison. That's easy now, make your own directive based on st-search and change
```
var filter = ctrl.registerFilter('search');
```
into
```
var filter = ctrl.registerFilter('myStrictFilter', true);
```
Maybe you would like to use a select box for selecting values in a range (\<10, 10-100, \>100), then
(example code, please don't copy)
```
var filter = ctrl.registerFilter('myRangeFilter', function(actual, expected){
if (expected) {
if (expected==='<10') {
return actual < 10;
}
if (expected==='10-100') {
return actual >=10 && actual <= 100;
}
if (expected==='>100') {
return actual > 100;
}
}
return true;
});
```

I think I was able to implement the filter plugin feature without to much changes in the core. The only thing is, that I removed method 'search' but I think that method was mainly exposed for test purposes (do other developers use this method in their own directives?).