-
24 Sep 2012 6:42 AM #1
Grid reconfigure change with 4.1.2
Grid reconfigure change with 4.1.2
When calling reconfigure() on a grid, you can pass a store and a columns parameter. The documentation says:
Reconfigures the grid with a new store/columns. Either the store or the columns can be omitted if you don't wish to change them.
This was true in 4.1.1, but after installing 4.1.2 last week, our grids started having problems. This is because code was added to the reconfigure() function to always unbind the current store:
The store property now always gets nulled out after calling reconfigure() and we start having problems.Code:if (me.store) { me.unbindStore(); }
I have resolved this by always passing in the current store to the reconfigure() call, but want to make this this is correct and that the documentation just needs to be updated.
-
24 Sep 2012 6:59 AM #2
Thanks for the report! I have opened a bug in our bug tracker to update API
Scott
-
2 Oct 2012 5:10 AM #3
To fix while waiting for the next version..
Code:Ext.override(Ext.panel.Table, { reconfigure: function(store, columns) { var me = this, oldStore = me.store, headerCt = me.headerCt, oldColumns = headerCt ? headerCt.items.getRange() : me.columns; // Make copy in case the beforereconfigure listener mutates it. if (columns) { columns = Ext.Array.slice(columns); } me.fireEvent('beforereconfigure', me, store, columns, oldStore, oldColumns); if (me.lockable) { me.reconfigureLockable(store, columns); } else { Ext.suspendLayouts(); if (columns) { // new columns, delete scroll pos delete me.scrollLeftPos; headerCt.removeAll(); headerCt.add(columns); } if (store) { //moved following "if" block inside the "if (store)" block if (me.store) { me.unbindStore(); } store = Ext.StoreManager.lookup(store); me.bindStore(store); } else { me.getView().refresh(); } headerCt.setSortState(); Ext.resumeLayouts(true); } me.fireEvent('reconfigure', me, store, columns, oldStore, oldColumns); } });
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-7335
in
4.1.3 Sprint 1.


Reply With Quote