1. #1
    Sencha Premium Member
    Join Date
    Jun 2009
    Posts
    18
    Vote Rating
    0
    coolrb is on a distinguished road

      0  

    Default Problem using tree inside accordion

    Problem using tree inside accordion


    Hi,
    I am trying to use a tree in inside accordion and it is appearing properly. But clicking on any node, it simply keep on expanding tree by loading all child again. You might want to take a look the screenshot.
    I am reusing border layout example and add the tree of Drag and Drop Reordering example inside west panel of border layout example. Please find my tree code.

    HTML Code:
    Ext.onReady(function(){
        // shorthand
        var Tree = Ext.tree;
        
        var tree = new Tree.TreePanel({
            el:'tree-div',
            useArrows:true,
            autoScroll:true,
            animate:true,
            enableDD:false,
            containerScroll: true,
    
            // auto create TreeLoader
            dataUrl: 'demo/sandbox.jsp',
    
            root: {
                nodeType: 'async',
                text: 'Ext JS',
                draggable:false,
                id:'source'
            }
        });
    
        // render the tree
        tree.render();
        tree.getRootNode().expand();
    });
    Attached Images

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,112
    Vote Rating
    504
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    So, the tree works fine outside the accordion? What data is your page returning? Look at it in Fbug.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2009
    Posts
    18
    Vote Rating
    0
    coolrb is on a distinguished road

      0  

    Default


    Yes it works fine outside the accordion.
    I just copied data from one of example and please find below
    HTML Code:
    [{"text":"build","id":"\/build","cls":"folder"},{"text":"INCLUDE_ORDER.txt","id":"\/INCLUDE_ORDER.txt"
    ,"leaf":true,"cls":"file"},{"text":"ext-core.js","id":"\/ext-core.js","leaf":true,"cls":"file"},{"text"
    :"air","id":"\/air","cls":"folder"},{"text":"source","id":"\/source","cls":"folder"},{"text":"adapter"
    ,"id":"\/adapter","cls":"folder"},{"text":"examples","id":"\/examples","cls":"folder"},{"text":"docs"
    ,"id":"\/docs","cls":"folder"},{"text":"ext-all.js","id":"\/ext-all.js","leaf":true,"cls":"file"},{"text"
    :"license.txt","id":"\/license.txt","leaf":true,"cls":"file"},{"text":"ext-core-debug.js","id":"\/ext-core-debug
    .js","leaf":true,"cls":"file"},{"text":"ext-all-debug.js","id":"\/ext-all-debug.js","leaf":true,"cls"
    :"file"},{"text":"resources","id":"\/resources","cls":"folder"},{"text":"CHANGES.html","id":"\/CHANGES
    .html","leaf":true,"cls":"file"}]

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Quote Originally Posted by coolrb View Post
    Yes it works fine outside the accordion.
    I would think it behaves in the same way.

    It passes to the server, the ID of the node for which it is requesting child nodes.

    The server must then respond with the correct list of child nodes.

    It is your server which is responding incorrectly, always sending the same set of child nodes.

  5. #5
    Sencha Premium Member
    Join Date
    Jun 2009
    Posts
    18
    Vote Rating
    0
    coolrb is on a distinguished road

      0  

    Default Removed IDs and it still loads the whole tree as child of current node

    Removed IDs and it still loads the whole tree as child of current node


    I removed ids from tree and tree started working of collapsing the node, which was earlier not working. But then it still loads the whole tree as child of current node on click it not a leaf node.

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    It's your server which is telling it what to load. You have a bug.

  7. #7
    Sencha Premium Member
    Join Date
    Jun 2009
    Posts
    18
    Vote Rating
    0
    coolrb is on a distinguished road

      0  

    Default


    Thanks. Then how can I make TreeLoader customizable and send parameters to server to return values based on parameter like nodename

  8. #8
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    It currently sends the node's ID.

    If you want to make it send other params, use a beforeload listener.

    As explained and shown in the docs.

  9. #9
    Sencha Premium Member
    Join Date
    Jun 2009
    Posts
    18
    Vote Rating
    0
    coolrb is on a distinguished road

      0  

    Default


    Thanks, you are the man. Its much easier than I have thought. it seems to be better go thru all documentation.

    Thanks dude.

Thread Participants: 2

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