Open stepanets opened 8 years ago
This would make the filters so much more versatile. Currently if you have a dozen columns, but only one is custom, you still have to write cases for all 12 columns :(
+1 @stepanets
Depends on how you imagine the configuration @phazei, right?
Imagine attributing the customComparator
for a column name
like this (with an optional 2nd argument) : $scope.tableParams.filter({ name : searchText }, customComparator)
and that if we don't specify this 2nd argument the filterComparator
will be considered undefined
(= default filter).
But for that we would also need to redefine the structure of filterOptions
. Maybe like this - with a configuration for each column (with, as I said, by default, filterComparator: undefined
when it's not specified so no need to write each column case) :
filterOptions: {
column1 : {
filterComparator: undefined,
.
.
},
column2 : {
filterComparator: customComparator,
.
.
}, { ... }
}
Which means that the customComparator
will be used only when filtering column2
data.
(hope this is not a dumb idea.. I am currently confronted with the problem and this came to my mind)
It would be grate to have opportunity to define custom filter comparator or function by column. Like here but not for whole table.