PDA

View Full Version : [CLOSED] 4.0.2 grid reconfigure is broken



frankiew
22 Jun 2011, 12:40 PM
reconfigure: function(store, columns) {
var me = this,
headerCt = me.headerCt;

if (me.lockable) {
me.reconfigureLockable(store, columns);
} else {
headerCt.suspendLayout = true;
headerCt.removeAll();
if (columns) {
headerCt.add(columns);
} else {
headerCt.doLayout();
}
if (store) {
store = Ext.StoreManager.lookup(store);
me.bindStore(store);
} else {
me.getView().refresh();
}
if (columns) {
me.forceComponentLayout();
}
}
me.fireEvent('reconfigure', me);
}


if i dont pass the columns in, the result grid will not have any column because headerCt.removeAll(); called without any condition.

jsakalos
22 Jun 2011, 1:13 PM
if i dont pass the columns in

columns is a required argument so if you don't pass it you don't call reconfigure correctly.

frankiew
23 Jun 2011, 4:38 AM
According to the API, column is optional.


reconfigure( Ext.data.Store store, Array columns ) : void
Reconfigure the table with a new store/column. Either the store or the column can be ommitted if you don't wish to change them.

Parameters
store : Ext.data.Store
The new store.
columns : Array
An array of column configs
Returns
void

jsakalos
23 Jun 2011, 3:05 PM
Yes, you're right. It's either bug in documentation or bug in the code.

Moving this thread to Bugs.

evant
23 Jun 2011, 9:27 PM
Dupe of: http://www.sencha.com/forum/showthread.php?137807-Ext.grid.Panel-reconfigure-columns-cannot-be-ommited