You found a bug! We've classified it as
EXTJS-14075
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
-
Sencha User
Error in opening column header menu for Stateful Grid Grouping & Filter Features
Hi,
Description: Column Menu doesn't open for stateful grid having filter & grouping feature.
For Ext JS 4.2.2
We are using stateful grid having filter feature and grouping feature.
But when there is some state stored for filters, then opening of "column header menu" throws an error.
https://fiddle.sencha.com/#fiddle/7a7
(Enable Load Unsafe JavaScript by clicking “Shield” icon in address bar of ‘Chrome’ browser)
Steps to Reproduce:- Filter on name column.
- Rerun the fiddle, filters would be persisted.
- Now try opening any column header menu.
- It won't open and will throw an error.
Could you please provide some workaround/fix for this issue.
Thanks
Yogesh
-
Sencha User
workaround: Purge Menu Cache
Found this workaround because It starts working fine if column(s) is/are moved. 
// Menu changes when columns are moved. It will be recreated.
Code:
grid.headerCt.purgeCache();
Fiddle: https://fiddle.sencha.com/#fiddle/7he
-
Thanks for the workaround! A bug has been opened in our bug tracker to handle the issue.
-
Ext JS Premium Member
Did not work for us but the caching of the menu and the wrong order actually seems to be the problem.
Here is a workaround that seems to be fine
Ext.grid.feature.Grouping.showMenuBy
Code:
Ext.grid.feature.Grouping.override({ showMenuBy: function(t, header) {
if (this.grid.stateful) {
var menu = this.getMenu(),
groupMenuItem = menu.down('#groupMenuItem');
if (groupMenuItem == null) {
delete this.menu
}
}
this.callParent(arguments);
}
});