You found a bug! We've classified it as
EXTJS-20558
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
-
Sencha User
[E] Cannot override method statics on Ext.util.FilterCollection instance.
Ext version tested:
- Ext 6.0.0 (GPL)
- 5.0.0.736 in Fiddle
Browser versions tested against:
- Firefox 44.0.2
- Chrome 48.0.2564.109
Description:
When setting filters from a FilterCollection to a Store, console shows the error: "[E] Cannot override method statics on Ext.util.FilterCollection instance."
Diving into the framework code, I suspect the problem is in Ext.isIterable(ret) when called from decodeItems(): FilterCollection is not iterable (but should be), and inside "isIterable()", the special check with regexp iterableRe = /\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/ against FilterCollection fails because value.toString() returns "[object Object]" instead of an expected "[object FiterCollection]" (or alike).
Two possible solutions I can think of:
- Override in some way the Object.toString() (maybe in Base) and execute something like "value.prototype.toString()" and update the regexp, so #toString() returns the proper String.
- Make FilterCollection truly iterable (don't know if this is possible). The console shows FilterCollection instances as arrays! but then they are not iterable...
Maybe after solving this problem, they will appear other problems.
Steps to reproduce the problem:
https://fiddle.sencha.com/fiddle/15ui
and the error "[E] Cannot override method statics on Ext.util.FilterCollection instance." will appear in the console.
Workaround:
Add each filter as a single value. For example, instead of:
Code:
myStore.setFilters(filters);
do:
Code:
filters.each(
function(filterItem) {
myStore.addFilter(filterItem);
}
);
-
Thanks for the report! I have opened a bug in our bug tracker.
-
Sencha Premium User
This is still not fixed as of ExtJS 6.5.1 (May 2018)