Open cgebe opened 7 years ago
Hello @cgebe !
I see that source
object already supports this method: https://github.com/akveo/ng2-smart-table/blob/master/src/ng2-smart-table/lib/data-source/local/local.data-source.ts#L169
Does this method satisfy your goals?
Its not possible to create a boolean expression like formulated above with this method. The addFilter
method sets the andOperator for the filterConf
object, which means for all filters currently added.
Adding n
filters with andOperator = false
means n
filter are connected by OR. On top of that, you add one filter (n+1
) with andOperator = true
. Now the filterConf.andOperator
attribute is set to true and all filters get connected by AND.
See protected filter(data: Array<any>): Array<any>
https://github.com/akveo/ng2-smart-table/blob/master/src/ng2-smart-table/lib/data-source/local/local.data-source.ts#L236
This is a feature request:
Adding Filters individually with a boolean operator, instead of having one boolean operator for connecting all filters.
Example:
Now all filters are applied either by the AND operator or OR operator, which means expressions like:
It would be great to be able to add filters individually with their preceding operator to the filter chain.
would result in the following filter chain:
filter1 && filter2 || filter3 && filter4