-
4 Dec 2012 8:30 AM #1
Cannot unset the store from a dataview
Cannot unset the store from a dataview
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.1rc1
Browser versions tested against:- ____
- Chrome 23
DOCTYPE tested against:- html
Description:- Ext.mixin.Selectable - Cannot update store with new store as null (i.e. remove the existing store).
Steps to reproduce the problem:- Create a dataview
- Set a store for a dataview using useStore
- Try to remove the store by calling set store and passing it null
The result that was expected:- The store is removed from the view
The result that occurs instead:- An error occurs because Selectable tries to remove event listeners from the new store
Test Case:
Code:Ext.Viewport.add({ xtype : 'dataview', itemTpl : '{test}', store : { fields : ['test'], data : [ { test : 'foo' } ] }, items : [ { xtype : 'button', docked : 'top', text : 'setStore', ui : 'confirm', handler : function(btn) { var dv = btn.up('dataview'); dv.setStore(null); console.log(dv.getStore); } } ] });
HELPFUL INFORMATION
Debugging already done:- I have put in an override
Possible fix:- Put a little check
Operating System:- Win 8
Last edited by mitchellsimoens; 4 Dec 2012 at 9:11 AM. Reason: added test case
-
4 Dec 2012 9:14 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,581
- Vote Rating
- 433
I added a test case for this report.
IMO a DataView should always have a store but it shouldn't throw an error. The error is actually in the Selectable mixinMitchell 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.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3793
in
Sprint 29.


Reply With Quote