-
7 Feb 2013 12:14 PM #1
[4.1.3] Lockable grid giving a string instead of a Ext.data.Store on reconfigure
[4.1.3] Lockable grid giving a string instead of a Ext.data.Store on reconfigure
So I am seeing a really odd issue where lockable ('enableLocking: true') grids are firing reconfigure events with a string instead of a store object.
The string itself is the correct store class, so I can workaround the issue by downing a StoreManager lookup, but it isn't obeying the documented event signature.
This is the definition of reconfigure in Ext.panel.Table,
It looks like when the method goes into reconfigureLockable it never assigns store to the store object. and thus fireEvent will fire with a String in the store variable.Code:reconfigure: function(store, columns) { var me = this, view = me.getView(), originalDeferinitialRefresh, 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) { // Only unbind the store if a new one was passed if (me.store) { me.unbindStore(); } store = Ext.StoreManager.lookup(store); // On reconfigure, view refresh must be inline. originalDeferinitialRefresh = view.deferInitialRefresh; view.deferInitialRefresh = false; me.bindStore(store); view.deferInitialRefresh = originalDeferinitialRefresh; } else { me.getView().refresh(); } headerCt.setSortState(); Ext.resumeLayouts(true); } me.fireEvent('reconfigure', me, store, columns, oldStore, oldColumns); }
-
7 Feb 2013 1:16 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
Can I get a local test case to reproduce this?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Feb 2013 1:47 PM #3
If you create a grid with enableLocking: true, put a listener on the grid.reconfigure event and reconfigure the store on the grid, you should see store being passed into the event handler as a string.
Sorry the example in my codebase is to convoluted for me to post on a forum, but looking at the code it is clear to me that store will never be a Ext.data.Store as documented when taking the lockable code path.
-
9 Feb 2013 1:54 AM #4Sencha - Community Support Team
- Join Date
- Nov 2007
- Location
- Helsingborg, Sweden
- Posts
- 2,455
- Vote Rating
- 48
So you're calling reconfigure with a string as the store?
API dictates it should be a real store instance... http://docs.sencha.com/ext-js/4-1/#!...od-reconfigureCode:grid.reconfigure(storeAsString)
-
11 Feb 2013 11:13 AM #5
Ah, yes I was using a store id string instead of of a store object, my bad. Once I corrected that it looks like it works as expected. Sorry about the false alarm.
So I see that is documented in the signature, but why does the standard reconfigure and a locked grid reconfigure both do a lookup on the store if it's expected to be a store object?
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote