Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1152 in 2.0.
  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    5
    Vote Rating
    0
    anderfsilva is on a distinguished road

      0  

    Default 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?

    Code:
    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
            });
    
    
        }
    });
    tks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,624
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    5
    Vote Rating
    0
    anderfsilva is on a distinguished road

      0  

    Default


    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
    		});
    
    	}
    });

  4. #4
    Sencha - Sencha Touch Dev Team
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,235
    Vote Rating
    4
    TommyMaintz will become famous soon enough

      0  

    Default


    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.