6 Answers, 1 is accepted
The described result occurs because the filter operator of the AutoComplete used for filtering is "starts with" by default and it is not the same as the actual filter operator of the Grid.
The default operator can be changed per column using the columns.filterable.cell.suggestionOperator property of the Grid:
I hope this is helpful.
Maybe I'm missing something but the above doesn't seem to fully answer the issue raised.
I understand that if you want the default operator to be "Contains", then you should also set the suggestionOperator to "Contains".
But that's not the issue, at least in my case. In my case, I want the default to be "Starts with", which it is. But I'm using the filter row, and if the user drops down the operator selector and changes it to "Contains", then starts typing, the result incorrectly shows "No Data Found" even though there is matching data present corresponding to the "Contains" filter.
How can this scenario be corrected so that what's displayed in the filter row result matches the user's selected operator?
The "suggestOperator" is a property that applies only for the AutoComplete widget in the filter row and that operator will not be changed when the user changes the operator for the filtering of the column. Those are two different operators: one for the filtering of the column and one for the filtering of the filter widget.
Hope this helps.
Not really. I still don't understand how to resolve the bug I'm encountering, which again is: I include a filter row in my grid, the user changes the operator for a particular text column from the default of "Starts with" to "Contains", then starts typing. The filter UI incorrectly acts as if the operator is "Starts with" and even if there is data in that column which matches the user's typed text using a Contains filter, it incorrectly shows "NO DATA FOUND".
If the user then presses <Enter> to leave the filter, the grid correctly shows the "Contains" resulting data, so the filter itself worked in the end. But while the user is in the filter row typing, it's not working correctly. How do I resolve that issue?
The AutoComplete widget in the filter row displays items, so that the user can easily find an existing value and select it if needed. As documented in the following help topic, the suggestionOperator is separate from the filtering mechanism of the Grid and it applies only to the AutoComplete:
I would suggest keeping the suggestionOperator to "contains", which will return items in the drop down from which the user could choose from (if needed).