PDA

View Full Version : GroupSummary isGrouped does not return expected result



justin.wesley
23 Nov 2011, 8:49 AM
Ext version tested:

Ext 3.4.0


Adapter used:

ext


css used:

only default ext-all.css


Browser versions tested against:

IE 8
FF 3.6.18 (firebug 1.7.3 installed)

Description:

The function isGrouped of the GroupSummary grid plugin does not return the expected result after the GroupingStore invokes the clearGrouping function.

The original function is:

isGrouped : function(){
return !Ext.isEmpty(this.grid.getStore().groupField);
}

This causes problems when clearGrouping is called because groupField is set to false. When false is sent to Ext.isEmpty, the result is false.

The function should really be:

isGrouped: function(){
var groupField = this.grid.getStore().groupField;
return !Ext.isEmpty(groupField) && groupField !== false;
}

The downstream effects of this is that when ever a grid has the GroupSummary plugin and the clearGrouping function has been called either through the menu or from applyState, there will be javascript when trying to resize a column. In IE, resizing a column actually causes some pretty weird visual side effects.

justin.wesley
23 Nov 2011, 8:52 AM
I put the following code in one of our javascript files to alleviate the issue:

Ext.ux.grid.GroupSummary.override({
isGrouped: function(){
var groupField = this.grid.getStore().groupField;
return !Ext.isEmpty(groupField) && groupField !== false;
}
});