PDA

View Full Version : how to retrieve value from ColumnTree



columbus30
15 Aug 2009, 11:11 AM
How can the values from ColumnTree be retrieved? i need the value of nodes from column tree.


var rootData = new Ext.tree.AsyncTreeNode({
id:'rootData',
allowChildren: true,
children: [{
menu_item: "Group Task1",
menu_url: '100',
uiProvider:'col',
children: [{
menu_item: "Subgroup Task1",
menu_url: '40',
uiProvider:'col',
leaf:true
}]

var tree = new Ext.tree.ColumnTree({
el: 'tree-ct',
id:'coltree',
rootVisible: false,
autoScroll: true,
expandable: false,
enableDD: true,
loader: new Ext.tree.TreeLoader({
preloadChildren: true,
uiProviders: {
'col': Ext.tree.ColumnNodeUI
}
}),
root: rootData
please give some hints..i tried tree.node.attributes but without any success.I need something like when we retrieve data from grid we write grid.store.data,so wat can be in case ColumnTree.

Condor
17 Aug 2009, 2:53 AM
In a tree the data is hierarchical, so you can't simply get the data in an array.

You could use:

var root = treePanel.getRootNode();
var groupTask1 = root.childNodes[0];
var subgroupTask1 = groupTask1.childNodes[0]
var menuUrl = subgroupTask1.attributes.menu_url;

columbus30
17 Aug 2009, 4:03 AM
Thanks for help !!