Results 1 to 2 of 2

Thread: Using a TreeStore with Ext Direct

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2010
    Posts
    35
    Vote Rating
    1
      0  

    Default Using a TreeStore with Ext Direct

    I've been playing around with Ext Direct, trying to get some basics up and running, and I cannot figure out how to get a TreeStore working correctly. I keep getting the following error :

    Uncaught TypeError: Cannot call method 'set' of undefined" TreeStore.js:667

    API
    Code:
    Ext.ns('DW');
    DW.REMOTING_API = {
    "url":"api\/router.cfm",
    "namespace":"DW",
    "type":"remoting",
    "actions":{
        "user":[{"len":0,"name":"getNav"}]}
    };
    Main Controller
    Code:
        init:function(){        var me = this;
            Ext.direct.Manager.addProvider(DW.REMOTING_API);
            
            var store = Ext.create('Ext.data.TreeStore',{
                proxy:{
                    type:'direct',
                    directFn:'DW.user.getNav'
                },
                storeId:'navStore'
            })
    
    
            store.load(function(o){
                console.dir(o)
            });
        
        }
    Data returned from router
    Code:
    [{"result":[{"text":"test","leaf":false},{"text":"test2","leaf":false}],"tid":1,"method":"getNav","data":"null","action":"user","type":"rpc"}]
    I've been trying to use the example here since the examples in the Docs appear to be broken, but even though I feel I've done everything the same it just doesn't seem to be working.

    Any help is greatly appreciated.

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,026
    Vote Rating
    1367
      1  

    Default

    You shouldn't have to call store.load, the store should load when the root node is expanded
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

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
  •