-
29 Nov 2011 8:57 AM #1
TreeStore with proxy duplicate list
TreeStore with proxy duplicate list
The code as is works fine, but when I remove the "root: date" and uncomment the block that performs the query on the server it duplicates my list displaying twice "Drinks". I noticed that it makes twice requisitions the server.
Someone knows why does it makes two requests and duplicate the list?
tksCode:Ext.application({ launch : function() { var data = { items : [{ text : 'Drinks', items : [{ text : 'Water', items : [{ text : 'Sparkling', leaf : true }, { text : 'Still', leaf : true }] }, { text : 'Coffee', leaf : true }] }] }; Ext.regModel('model', { fields : [{ name : 'text', type : 'string' }] }); var store = new Ext.data.TreeStore({ model : 'model', defaultRootProperty : 'items', root : data // proxy : { // type : 'jsonp', // url : 'http://192.168.0.4:9000/', // reader : { // type : 'json' // } // } }); Ext.create('Ext.NestedList', { fullscreen : true, title : 'Menu', displayField : 'text', store : store }); } });
-
29 Nov 2011 1:07 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
Reporting this as a bug. Thank you for the test case!
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.
-
20 Dec 2011 4:14 PM #3
Checking the source code I have identified that if the property "root" is not informed the TreeStore load method is called again, so just add "root: {}".
Code:Ext.application({ launch : function() { Ext.regModel('model', { fields : [{ name : 'text', type : 'string' }] }); var store = new Ext.data.TreeStore({ model : 'model', defaultRootProperty : 'items', root : {}, proxy : { type : 'jsonp', url : 'http://localhost:9000/', reader : { type : 'json' } } }); Ext.create('Ext.NestedList', { fullscreen : true, displayField : 'text', store : store }); } });
-
13 Jan 2012 10:37 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
This has been fixed as part of the data package cleanup, and will be part of the next Touch 2.0 release. We did a lot of work on TreeStore's, NodeStores and NodeInterface, hopefully reducing the number of bugs in it dramatically. Thanks again for the report and let us know if you still have issues related to this after the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1152
in
2.0.


Reply With Quote
