PDA

View Full Version : [CLOSED] Grid Reconfigure and RowExpander



vgvallee
May 30, 2013, 10:45 PM
I have a GridPanel that has no Store initially. Then, I want to tie it to one. I can do it with the following:



grid.reconfigure(store);


This works well until I have a RowExpander on the GridPanel. Then, I get an error during the beforeReconfigure event of the RowExpander because the columns variable in the function call is undefined.



beforeReconfigure: function (grid, store, columns, oldStore, oldColumns) {
var expander = this.getHeaderConfig();
expander.locked = true;
columns.unshift(expander);
},


I thought that this parameter was optional... If I call the reconfigure with the current grid columns like so:



grid.reconfigure(store, grid.columns);


then it does go through but I end up with 2 expander columns and loose columns that are nested.

Baidaly
May 31, 2013, 2:09 AM
Hello!

Try to use the following overriding:



Ext.override(Ext.ux.RowExpander, {
beforeReconfigure: function (grid, store, columns, oldStore, oldColumns) {
var expander = this.getHeaderConfig();
expander.locked = true;
if (columns)
columns.unshift(expander);
}
});

Daniil
May 31, 2013, 11:15 AM
Hi,

Reported to Sencha.
http://www.sencha.com/forum/showthread.php?264949
and fixed in the SVN trunk.

Thank you for the report.

vgvallee
May 31, 2013, 5:13 PM
Works like a charm with the override; the original column definitions are as they should.

Are you saying that I don't need to include this override myself if I update from SVN?

Baidaly
May 31, 2013, 9:30 PM
Works like a charm with the override; the original column definitions are as they should.

Are you saying that I don't need to include this override myself if I update from SVN?

Yes, if you update from SVN it already has this fix so you don't need to include it.