Ext version tested:

  • Ext JS 5.0.1.1255

  • Ext JS 5.0.0.970


Browser versions tested against: DOCTYPE tested against: Description:

  • When using multiple levels of inheritance in grids and giving xtype to each level, a grid with lockable columns calls the wrong constructor for the locked-column subgrid.


Steps to reproduce the problem:

  • Define two grids with inheritance: Ext.grid.Panel > com.example.One > com.example.Two

  • Give both custom gridpanels an alias

  • instantiate grid Two with at least one locked column


The result that was expected:

  • initComponent of One and Two are called exactly once, all config options are accessible


The result that occurs instead:

  • initComponent of One is called two times. For the normal inheritance order of the grids (expected) and for the subgrid containing the locked columns

  • subgrid initialization does not get all config options from original Ext.create call


Fiddle:


http://ift.tt/1BuC0Fd

Look at the console output.

Output actually is:



Code:



Init TestGridOne.
undefined
Init TestGridOne.
aValue
Init TestGridTwo.
aValue

Expected output:


Code:



Init TestGridOne.
aValue
Init TestGridTwo.
aValue

It works, however, if we omit the aliases for the two custom grids.

http://ift.tt/10cL3PD


Track-down

As far as we can see, the problem lies in Ext.grid.locking.Lockable#determineXTypeToCreate

In case of the subgrid with the non-locked columns always a 'gridpanel' is created. In the case of the subgrid WITH the locked columns there is some special handling here regarding treepanel:



Code:



// Treeness only moves down into the locked side.
// The normal side is always just a grid
if (!lockedSide) {
return 'gridpanel';
}
xtypes = this.getXTypes().split('/');
xtypesLn = xtypes.length;
xtype = xtypes[xtypesLn - 1];
superxtype = xtypes[xtypesLn - 2];


if (superxtype !== 'tablepanel') {
typeToCreate = superxtype;
} else {
typeToCreate = xtype;
}

This only considers one level of inheritance. With more levels of inheritance always the type of the first ancestor is used. Expectation would be always either 'gridpanel' or 'treepanel', but never a custom type.

Regards

David