View Full Version : [CLOSED][4.0.0] Store constructor needs me.groupers, me.groupField, me.groupDir

19 May 2011, 10:49 AM
The Ext.data.Store constructor does not check for existing me.groupers, me.groupField or me.groupDir properties to see if grouping has been pre-defined on the store. It only looks for grouping information in the config object passed to the constructor.

Since Ext.app.Application instantiates the Ext.data.Store when the app first loads (I have the store listed in my controller) there is no way to pass grouping information to the constructor without a workaround (at the very bottom).

Around line 327:

groupers = config.groupers,

should be:

groupers = config.groupers || me.groupers,

Around line 383:

if (!groupers && config.groupField) {
groupers = [{
property : config.groupField,
direction: config.groupDir

Should be:

if (!groupers && (config.groupField || me.groupField)) {
groupers = [{
property : config.groupField || me.groupField,
direction: config.groupDir || me.groupDir

As a workaround I overrode my Ext.data.Store subclass constructor and applied the grouping properties to the config:

constructor: function(config) {
Ext.applyIf(config, { groupField: this.groupField });

19 May 2011, 8:47 PM
I believe this should be resolved as of 4.0.1.

From the release notes: [EXTJSIV-1813] - Store Can't read grouping info when specified on the class definition