Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha User
[6.7.0 classic] The new Ext.data.Query issue with GridFilters plugin
If a GridPanel has the GridFilters plugin enabled, even if no specific feature of that plug in is used, -and- an Ext.data.Query filter is added, the next filter add (tested just adding another Ext.data.Query filter over) will trigger an exception from Ext.grid.filters.Filters.onRemoveFilter().
The issue can be reproduced in this fiddle:
Notice, you should click a second time to apply a filter (no matter if it is the same or another one, as long as onRemoveFilter() gets called and the current filter is a Ext.data.Query one, the routine will break.
-
The new Ext.data.Query fellow is only supported in the modern grid filter plugin (to my knowledge). The classic plugin has likely not been updated to support it.
Don Griffin
"Use the source, Luke!"
-
It may be possible (on further thought) to keep the Query from causing issues with the plugin by assigning id's to it. I'd have to check on that...
Don Griffin
"Use the source, Luke!"
-
Sencha User
Hello @dongryphon, thanks for your kind feedback!
According to the documentation, the Ext.data.Query belongs to the classic toolkit: https://docs.sencha.com/extjs/6.7.0/...ata.Query.html
In practice, it works in classic, as can be seen in the fiddle shared on the first post.
Assigning an ID to the queries on the original fiddle above "works", as it will prevent calling removeFilter(), but then the filter is cumulative (so all rules will apply); if attempting to replace another filter (with both having same ID), the same issue will happen. So this condition can be added to the issue case:
- where both filter added have the same ID (or no ID at all),
- expected: replace first filter with the new one, as happens without having the GridFilters plugin enabled
- actual: exception is thrown.
-
Sencha User
Original fiddle updated to include Ext.emptyFn as Ext.data.Query.getProperty (semantically meaning that the affected field by the filter is unspecified).