1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Washington, DC
    Posts
    11
    Vote Rating
    2
    yury.sannikov is on a distinguished road

      0  

    Default Answered: NestedList goes to root node after dynamic node load

    Answered: NestedList goes to root node after dynamic node load


    I have very large document tree. In order to use it I use dynamic node load feature. But, after node successfully loaded to the list I end up getting back to the root node. If the node already in memory I can navigate to it without problems.

    The following code I use to load:
    Code:
    Ext.define('BpolMobile.model.DocumentList', {
        extend: 'Ext.data.Model',
        config: {
            fields: [
                {name: 'text', type: 'string'}
            ]
        }
    });
    
    .....
    {
        xtype: 'nestedlist',
        id: 'nestedList',
        store: {
            type: 'tree',
            id: 'NestedListStore',
            model: 'BpolMobile.model.DocumentList',
            defaultRootProperty: 'children',
            nodeParam: 'nodeId',
            root: {},
            proxy:
            {
                method: 'GET',
                type: 'ajax',
                url: '/mobile/ajax/DocumentList.svc/GetDocumentList',
                autoLoad: true,
                extraParams:
                {
                    loginToken: BpolApp.getInstance().loginToken
                }
            }
        },
         displayField: 'text',
    },
    /mobile/ajax/DocumentList.svc/GetDocumentList return the list:
    Code:
    [
        {
            "children": null,
            "id": 3668833,
            "leaf": false,
            "text": "!Revisions_test"
        },
        {
            "children": null,
            "id": 3669207,
            "leaf": false,
            "text": "!Revisions_test2"
        }
    ]
    When I tap to the !Revisions_test, proper request is issued and the result data applied correctly. But I'm end up returning to the root list, because NestedList::onStoreLoad fired each time child node loaded

    Code:
        onStoreLoad: function(store) {
            this.setMasked(false);
            this.fireEvent('load', [this, Array.prototype.slice.call(arguments)]);
            this.goToNode(store.getRoot());
        },
    The last line leads me to the root node.

    I suspect, that onStoreLoad should be fired only once. Could you please explain this behaviour? Maybe I do something wrong?

  2. You should try with 2.0.1 RC, the onStoreLoad has changed a bit that will most likely help you here.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,642
    Vote Rating
    899
    Answers
    3574
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should try with 2.0.1 RC, the onStoreLoad has changed a bit that will most likely help you here.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Location
    Washington, DC
    Posts
    11
    Vote Rating
    2
    yury.sannikov is on a distinguished road

      0  

    Default


    Thank you very much. Where can I get 2.0.1 RC? Only 2.0.0 is accessible at the download page.

  5. #4

  6. #5
    Sencha User
    Join Date
    Mar 2012
    Location
    Washington, DC
    Posts
    11
    Vote Rating
    2
    yury.sannikov is on a distinguished road

      0  

    Default


    Thanks

  7. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,642
    Vote Rating
    899
    Answers
    3574
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1