PDA

View Full Version : BUG: RowExpander columns property is dependent on header config



zombeerose
20 May 2011, 11:40 AM
Based on this post (http://www.sencha.com/forum/showthread.php?133149-ExtJS-4-Grid-Column-default-config-options), I realized that the grid columns config can be defined as a Ext.grid.header.Container or xtype:'headercontainer'. This was helpful in order to apply defaults to all columns.

However, this variation in column configuration broke the rowexpander plugin on line 101 in the constructor
grid.columns.unshift(this.getHeaderConfig()); because columns was no longer an array. Changes are highlighted in red:



constructor: function() {
this.callParent(arguments);
var grid = this.getCmp(),
columns = grid.columns;

...


if (columns instanceof Ext.grid.header.Container){
columns = columns.items.items;
} else {
if (Ext.isObject(columns)){
columns = columns.items;
}
}
columns.unshift(this.getHeaderConfig());
grid.on('afterlayout', this.onGridAfterLayout, this, {single: true});
}//eof constructor