-
17 Jun 2009 1:55 AM #1
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(); });
-
17 Jun 2009 1:57 AM #2
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!
-
17 Jun 2009 3:08 AM #3
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"}]
-
17 Jun 2009 3:17 AM #4
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Jun 2009 3:19 AM #5
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.
-
17 Jun 2009 3:23 AM #6
It's your server which is telling it what to load. You have a bug.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Jun 2009 3:31 AM #7
Thanks. Then how can I make TreeLoader customizable and send parameters to server to return values based on parameter like nodename
-
17 Jun 2009 3:42 AM #8
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Jun 2009 4:02 AM #9
Thanks, you are the man. Its much easier than I have thought. it seems to be better go thru all documentation.
Thanks dude.


Reply With Quote
