1. #1
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    4
    Vote Rating
    0
    re.tf is on a distinguished road

      0  

    Default Reload tree problem: Uncaught TypeError: Cannot read property 'internalId' of undefi

    Reload tree problem: Uncaught TypeError: Cannot read property 'internalId' of undefi


    Hi all,


    I have one an error in my ‘reload’of my tree. If any one can poitme the error! Tks!!


    My code:


    # Response (JSON)


    // Initial Load


    {
    "success":"true",
    "id":"a08dd1c2-82e4-423f-9713-e1d43d2982ee",
    "cd":"0",


    "list":
    [{"text":"2009","id":"y:2009","leaf":"false","count":"1527","cls":"folder"},{"text":"2010","id":"y:2010","leaf":"false","count":"5624","cls":"folder"},{"text":"2011","id":"y:2011","leaf":"false","count":"6247","cls":"folder"},{"text":"2012","id":"y:2012","leaf":"false","count":"5992","cls":"folder"}]
    }


    // If I click in 2009 node (expand node)


    {
    "success":"true",
    "id":"c1da69eb-cb25-4a4c-ad20-5ab156cb8c19",
    "cd":"0",


    "list":
    [{"text":"08","id":"m:08:y:2009","leaf":"false","count":"61","cls":"folder"},{"text":"09","id":"m:09:y:2009","leaf":"false","count":"390","cls":"folder"},{"text":"10","id":"m:10:y:2009","leaf":"false","count":"411","cls":"folder"},{"text":"11","id":"m:11:y:2009","leaf":"false","count":"405","cls":"folder"},{"text":"12","id":"m:12:y:2009","leaf":"false","count":"260","cls":"folder"}]
    }




    # Model


    Ext.define('Node', {
    extend: 'Ext.data.Model',
    idProperty: 'id',
    fields: [
    {name: 'text', type: 'string'},
    {name: 'id', type: 'string'},
    {name: 'count', type: 'string'}
    ]
    });


    # Store


    var store = Ext.create('Ext.data.TreeStore', {
    model: 'Node',
    proxy: {
    type: 'ajax',
    url: 'dswapi/1.0/json/domain?did=test',
    headers:
    {
    'Authorization' : 'test'
    },
    folderSort: true,
    reader: {
    type: 'json',
    root: 'list'
    }
    },
    root: {
    text: 'Root',
    id: 'src',
    expanded: true
    }
    });




    # my Tree




    var tree = Ext.create('Ext.tree.Panel', {
    store: store,
    rootVisible: true,


    dockedItems: [{
    xtype: 'toolbar',
    dock: 'bottom',
    items: [{
    text: 'Update',
    icon: 'accept.png',
    scope: this,
    handler: function() { store.reload({params: {refresh: '1', from: 'reload'}}); // Uncaught TypeError: Cannot read property 'internalId' of undefined
    }
    }]
    }],


    columns: [{
    xtype: 'treecolumn',
    text: 'F',
    flex: 2,
    sortable: true,
    dataIndex: 'text'
    },{
    text: '#',
    flex: 1,
    dataIndex: 'count',
    sortable: true
    }],

    border: false,
    bodyBorder:false,


    width: 955,
    maxWidth: 955,
    height: 300,

    renderTo: 'gridAnchor'
    });


    Any help!!!
    tks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    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


    What Ext JS 4 version are you using? I have used the load/reload method on the tree store just yesterday and it worked for me in 4.1.1

    When posting code, please use BBCode's CODE tags
    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
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    4
    Vote Rating
    0
    re.tf is on a distinguished road

      0  

    Default


    4.1.1 too. Sorry a will use in next post!