Hybrid View
-
12 Jan 2009 6:14 AM #1
Dynamic URL of TreeLoader in ColumnTree
Dynamic URL of TreeLoader in ColumnTree
Hi,
I have a textfield and columntree in a page. I want to construct the url for the TreeLoader based on the userinput in the textfield.
All the columntree examples I saw sets the loader and its url at the time of creation of the tree.
How can I dynamically change the loader URL for the columntree?
Also the tree should load its data only when the user enters a value in the textfield and clicks a button.
I tried settingin the button's click event and then triedCode:tree.loader.url = <new url>
. But it didn't work.Code:tree.loader.load(tree.root)
-
13 Jan 2009 9:31 PM #2
I am also having same problem . Can i pass Json object directly to the dataurl
-
13 Aug 2009 11:52 PM #3
-
6 Jan 2010 4:00 AM #4
Same problem here..
The API docs don't show a 'reload' function for the ColumnTree or it's loader.
I tried a few things without success like:
SeanCode:var urlToLoad = '/admin/get-info.php?cname=' + node.id; columnTree.loader = new Ext.tree.TreeLoader({ dataUrl: urlToLoad, uiProviders:{ 'col': Ext.tree.ColumnNodeUI } });
-
6 Jan 2010 4:15 AM #5
Ok found the solution...
The root is an AsyncTreeNode as follows
and the API for AsyncTreeNode contains a 'reload' function that takes a callback function as a parameter.Code:root: new Ext.tree.AsyncTreeNode({ text:'Info' })
This works for me:
SeanCode:columnTree.getRootNode().reload(null);
-
23 Dec 2010 2:42 AM #6


Reply With Quote
