Open vladimirivanoviliev opened 4 years ago
In this example "Buffy" is shown because "Gage" is not equal to Buffy" and all Parents of "Gage" are shown in order for it to be visible.
Same will happen if we filter using "Contains" "s" even if Buffy does not contains "s", because it's children do.
Although this is expected behaviour from my point of view, I still see value in option where: All parents in the chain needs to fulfil the query in order to be visible by making the filter more strict.
We could add an article showing "How to change the filterBy behavior" or "How to implement your own filterBy function". No need to change current functionality.
I'm either for option or for making not
operators work out of the box with ignoring children of filtered items. For me at least the above example shows why current behavior is not ideal at least.
I kind of agree with both views, although that it is really difficult to determine what will the end user expect while filtering. Applying this for "not" operators only seems logical, because for other operators I would personally expect to get results for the children as well.
Currently the
filterBy
method of the TreeList does not support filtering without considering children, however cases requiring usingnot
operators are not working as expected:We should add option for controlling this in
filterBy
.