Added a filter-comparator attribute.
Now a different comparator can be specified for each row field.
This sets the comparator argument in AngularJS' filter.
If this attribute is omitted, the table defaults to a false value -- which means lowercase substring matching. If a function name is given, we will try to resolve it from the local scope and pass it as a comparator.
This is particularly useful when creating your own strict filtering on a field containing similar values (ie. "Field Unit" and "Field Unit Manager"). In the default behaviour, selecting "Field Unit" from a dropdown would match rows with both of the types.
This also allows for some degree of extensibility, allowing users to create their own comparators (think fuzzy-matching!).
Can you give an example of how this can be implemented?
@acd10 This was some time ago, but having re-read this PR I believe this is how it works:
On each column definition, you can set filterComparator field to true, false, a function name or a function.
truemeans strict matching is enabled for this fieldfalsegoes back to default behaviour- function (or a function name) specifies a comparator function when calling
$filter('filter')(itemsFilteredWithComparators, currentPattern, comparator). Useful for custom logic.