Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: TreeStore autoLoad

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-357 in a recent build.
  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    52
    Vote Rating
    0
      0  

    Default TreeStore autoLoad

    Sencha Touch version tested:
    • 1.1.0 (with PhoneGap)
    • only default ext-all.css




    Platform tested against:
    • iOS 4
    • OSX (Chrome, Safari)


    Description:
    • TreeStore with autoLoad property set to false
    • TreeStore used as store property of a NestedList
    • When the NestedList is instantiated the TreeStore automatically loads


    Test Case:

    Code:
    var data = {
        text: 'Groceries',
        items: [{
            text: 'Drinks',
            items: [{
                text: 'Water',
                items: [{
                    text: 'Sparkling',
                    leaf: true
                },{
                    text: 'Still',
                    leaf: true
                }]
            },{
                text: 'Coffee',
                leaf: true
            },{
                text: 'Espresso',
                leaf: true
            },{
                text: 'Redbull',
                leaf: true
            },{
                text: 'Coke',
                leaf: true
            },{
                text: 'Diet Coke',
                leaf: true
            }]
        },{
            text: 'Fruit',
            items: [{
                text: 'Bananas',
                leaf: true
            },{
                text: 'Lemon',
                leaf: true
            }]
        },{
            text: 'Snacks',
            items: [{
                text: 'Nuts',
                leaf: true
            },{
                text: 'Pretzels',
                leaf: true
            },{
                text: 'Wasabi Peas',
                leaf: true
            }]
        },{
            text: 'Empty Category',
            items: []
        }]
    };
    Ext.regModel('ListItem', {
        fields: [{name: 'text', type: 'string'}]
    });
    var store = new Ext.data.TreeStore({
        autoLoad: false,
        model: 'ListItem',
        root: data,
        proxy: {
            type: 'ajax',
            reader: {
                type: 'tree',
                root: 'items'
            }
        },
        listeners: {
    	    beforeLoad: function() {
    	        console.log('You didn't say store.load(), did you?');
            }
        }
    });
    var nestedList = new Ext.NestedList({
        fullscreen: true,
        title: 'Groceries',
        displayField: 'text',
        store: store
    });
    See this URL : http://


    Steps to reproduce the problem:
    • Implement a TreeStore with autoLoad set to false
    • Use the TreeStore as a NestedList's store
    • Instantiate the NestedList


    The result that was expected:
    • TreeStore does NOT load automatically
    • NestedList should not be responsible for loading the store (see e.g. List)


    The result that occurs instead:
    • TreeStore loads automatically


    Screenshot or Video:
    • no


    Debugging already done:
    • NestedList.initComponent calls NestedList.getSubList which calls NestedList.getListConfig which finally calls NestedList.store.getSubStore. At this point the TreeStore loads.


    Possible fix:
    • not provided
    Last edited by mbalsam; 11 Jul 2011 at 11:12 PM. Reason: Inforeq

  2. #2
    Sencha - Engineering Operations mike.estes's Avatar
    Join Date
    Mar 2011
    Location
    Redwood City, CA
    Posts
    221
    Vote Rating
    9
      0  

    Default

    Thanks for the report, please fill out this template and include a test case demonstrating the bug.

  3. #3
    Sencha User
    Join Date
    May 2011
    Posts
    52
    Vote Rating
    0
      0  

    Default

    Sencha Touch version tested:
    • 1.1.0 (with PhoneGap)
    • only default ext-all.css




    Platform tested against:
    • iOS 4
    • OSX (Chrome, Safari)


    Description:
    • TreeStore with autoLoad property set to false
    • TreeStore used as store property of a NestedList
    • When the NestedList is instantiated the TreeStore automatically loads


    Test Case:

    Code:
    var data = {
        text: 'Groceries',
        items: [{
            text: 'Drinks',
            items: [{
                text: 'Water',
                items: [{
                    text: 'Sparkling',
                    leaf: true
                },{
                    text: 'Still',
                    leaf: true
                }]
            },{
                text: 'Coffee',
                leaf: true
            },{
                text: 'Espresso',
                leaf: true
            },{
                text: 'Redbull',
                leaf: true
            },{
                text: 'Coke',
                leaf: true
            },{
                text: 'Diet Coke',
                leaf: true
            }]
        },{
            text: 'Fruit',
            items: [{
                text: 'Bananas',
                leaf: true
            },{
                text: 'Lemon',
                leaf: true
            }]
        },{
            text: 'Snacks',
            items: [{
                text: 'Nuts',
                leaf: true
            },{
                text: 'Pretzels',
                leaf: true
            },{
                text: 'Wasabi Peas',
                leaf: true
            }]
        },{
            text: 'Empty Category',
            items: []
        }]
    };
    Ext.regModel('ListItem', {
        fields: [{name: 'text', type: 'string'}]
    });
    var store = new Ext.data.TreeStore({
        autoLoad: false,
        model: 'ListItem',
        root: data,
        proxy: {
            type: 'ajax',
            reader: {
                type: 'tree',
                root: 'items'
            }
        },
        listeners: {
    	    beforeLoad: function() {
    	        console.log('You didn't say store.load(), did you?');
            }
        }
    });
    var nestedList = new Ext.NestedList({
        fullscreen: true,
        title: 'Groceries',
        displayField: 'text',
        store: store
    });
    See this URL : http://


    Steps to reproduce the problem:
    • Implement a TreeStore with autoLoad set to false
    • Use the TreeStore as a NestedList's store
    • Instantiate the NestedList


    The result that was expected:
    • TreeStore does NOT load automatically
    • NestedList should not be responsible for loading the store (see e.g. List)


    The result that occurs instead:
    • TreeStore loads automatically


    Screenshot or Video:
    • no


    Debugging already done:
    • NestedList.initComponent calls NestedList.getSubList which calls NestedList.getListConfig which finally calls NestedList.store.getSubStore. At this point the TreeStore loads.


    Possible fix:
    • not provided

  4. #4
    Sencha User
    Join Date
    May 2011
    Posts
    52
    Vote Rating
    0
      0  

    Default

    Bump... I have updated my initial post to match the template.

  5. #5
    Sencha User
    Join Date
    May 2011
    Posts
    52
    Vote Rating
    0
      0  

    Default

    I found the code, where the TreeStore.load is called. In NestedList's getListConfig method (which is called when the NestedList is created) store.getSubStore gets called which calls the getSubStore method of the selected recordNode (in this case the root node). The code of RecordNode.getSubStore looks like this:

    Code:
        getSubStore: function() {
    
            if (this.isLeaf()) {
                throw "Attempted to get a substore of a leaf node.";
            }
            
    
            var treeStore = this.getOwnerTree().treeStore;
            if (!this.subStore) {
                this.subStore = new Ext.data.Store({
                    model: treeStore.model
                });
                
                
                
                var children = this.getChildRecords();
                this.subStore.add.apply(this.subStore, children);
            }
    
            if (!this.loaded) {
                treeStore.load({
                    node: this
                });
            }
            return this.subStore;
        }
    I marked the part where the TreeStore is loaded red.

    So, once again, shouldn't the TreeStore only load when I, the developer, wants it, if autoLoad is set to false?

  6. #6
    Sencha User
    Join Date
    May 2011
    Posts
    52
    Vote Rating
    0
      0  

    Default

    filled out the template 6 days ago. would someone at least give me a sign if this is considered a bug or not?

  7. #7
    Sencha User
    Join Date
    Jun 2011
    Posts
    18
    Vote Rating
    0
      0  

    Default Same Here

    I was experiencing the exact same problem. While still learning Sencha Touch this was driving me up the wall and I am happy to have found this topic. I have commented out the lines pointed out by mbalsam and now it's working as expected for me.

  8. #8
    Sencha - Engineering Operations mike.estes's Avatar
    Join Date
    Mar 2011
    Location
    Redwood City, CA
    Posts
    221
    Vote Rating
    9
      0  

    Default

    sorry for the delay, we got this filed

  9. #9
    Sencha User
    Join Date
    May 2011
    Posts
    52
    Vote Rating
    0
      0  

    Default

    thanks for responding.

  10. #10
    Ext JS Premium Member
    Join Date
    Apr 2011
    Location
    Dallas, TX
    Posts
    204
    Vote Rating
    2
      0  

    Default

    Same problem in ExtJS 4.0.6

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •