1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    60
    Vote Rating
    1
    ImShogun is on a distinguished road

      0  

    Default Tree dataUrl working but same method isn't working trough Direct

    Tree dataUrl working but same method isn't working trough Direct


    Hello,

    I'm trying to use an Ext.Tree.TreeLoader to get the nodes for my tree, but it ain't working (I click, the loading icon show, then that's all.)

    My code:

    Code:
    //CANVAS GENERAL
            viewport = new Ext.Viewport({
                        xtype:'container',
                        layout:'border',
                        toolbar:Toolbar,
                        items:[
                            {
                                xtype:'treepanel',
                                //dataUrl:'extcfm/extjsmaker.cfc?method=getTreeNodes',
                                collapsible:true,
                                region:'west',
                                title:'ExtJS "dom" structure explorer',
                                width:250,
                                root: {
                                    id: 'root',
                                    text: 'HTML Template Body'
                                },
                                loader: new Ext.tree.TreeLoader({
                                       directFn: Ext.ss.extjsmaker.getTreeNodes
                                })                            
                            },
                            {
                                title:'About this Editor',
                                width:150,        
                                collapsible:true,                                                
                                region:'east',
                                padding:'5 5 5 5',
                                html:'ExtJS code being structured like a tree, let\'s just use <u>this</u> ExtJS+cfc+oracle little application to generate the ExtJS code itself...'
                            },
                            {
                                xtype:'panel',
                                region:'center',
                                title:'parameters'                                                
                            }
                        ]                    
                    });
        });
    When I adress my component trough dataUrl, this is the response I get:

    Code:
    [{"id":1.0,"text":"A leaf node","leaf":true},{"id":2.0,"text":"Another leaf node","leaf":true}]
    ...and it works perfectly, but when I query the very same component to my Direct implementation, nothing is happening, even if the result seems ok:

    Code:
    [{"method":"getTreeNodes","tid":2.0,"action":"extjsmaker","type":"rpc","result":[{"id":1.0,"text":"A leaf node","leaf":true},{"id":2.0,"text":"Another leaf node","leaf":true}]}]
    I don't understand. Do you?

    Thank you for your help!

    Laurent
    all:true

  2. #2
    Ext JS Premium Member Artistan's Avatar
    Join Date
    Apr 2007
    Location
    MN
    Posts
    144
    Vote Rating
    0
    Artistan is on a distinguished road

      0  

    Default


    I am also having this problem. Any solution yet???

  3. #3
    Ext JS Premium Member Artistan's Avatar
    Join Date
    Apr 2007
    Location
    MN
    Posts
    144
    Vote Rating
    0
    Artistan is on a distinguished road

      0  

    Default


    Found It!!

    http://www.extjs.com/forum/showthrea...536#post337536

    Ext.Direct Remoting With Tree

    http://www.extjs.com/deploy/ext-3.0-...irect-tree.php

    I have been doing alot of my code with reusable config arrays rather than creating new objects.
    If you paste this into firebug console and run on the URL above it will work.

    Code:
    try{
        var p = new Ext.Panel({
            title: 'TEST',
            //frame:true,
            items: [
                {
                    xtype: 'panel',
                    layout: 'fit',
                    deferredRender: true,
                    frame:true,
                    items: [{
                        title:'Tree Test',
                        xtype: 'treepanel',
                        width: 400,
                        height: 400,
                        useArrows: true,
                        autoScroll: true,
                        animate: true,
                        border: false,
                        tools: [
                            {
                                id:'refresh',
                                handler: function(event,toolEl,panel,toolconfig){
                                    console.log(event,toolEl,panel,toolconfig);
                                    panel.getRootNode().reload();
                                },
                                qtip:'Refresh'
                            }
                        ],
                        loader: new Ext.tree.TreeLoader({
                            directFn: TestAction.getTree,
                            listeners: {
                                load: function(tree,node,callback){
                                    try{
                                        console.log('tree load: ',tree,node,callback);
                                    }catch(e){
                                        console.log(e);
                                    }
                                }
                            }
                        }),
                        root: {
                            id: 'root',
                            text: 'Files',
                            expanded:true
                        },
                        fbar: [{
                            text: 'Reload root',
                            handler: function(obj,evnt){
                                var tree = obj.findParentByType('treepanel');
                                tree.getRootNode().reload();
                            }
                        }]
    
                    }]
                }
            ]
        }).render(Ext.getBody());
    
    } catch (e) {
    console.log(e);
    }
    Last edited by Artistan; 24 Sep 2009 at 7:48 AM. Reason: adding code...

  4. #4
    Sencha User
    Join Date
    Jul 2009
    Posts
    60
    Vote Rating
    1
    ImShogun is on a distinguished road

      0  

    Default


    Well, I still have the problem. I tryed your code but of course I can't use your action, so i did switch it with mine, and it is still not working.

    Could you paste the response you get from your method? maybe it will help me? I could then do some further debugging.

    Thanks
    all:true

  5. #5
    Ext JS Premium Member Artistan's Avatar
    Join Date
    Apr 2007
    Location
    MN
    Posts
    144
    Vote Rating
    0
    Artistan is on a distinguished road

      0  

    Default


    As I stated in the post with code...
    Goto Direct Tree Example and open firebug. Paste the code and the console and run it. You can see the response for yourself!!

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar