View Full Version : treepanel click

27 Oct 2010, 3:36 PM
I have a simple TreePanel.
var menu = new Ext.tree.TreePanel({
id: menu,
autoScroll: true,
animate: true,
enableDD: false,
border: false,
containerScroll: true,
dataUrl: 'get-nodes.php',
rootVisible: false,
root: {
nodeType: 'async',
text: 'Tree Root',
draggable: false,
id: '0'
Data, which is received via get-nodes.php is structured in the following way:
I need to do the following thing. On click of each node i need to redirect to the uri, this node provided.

I tried something like this. I've added listener into the tree
listeners: {
click: function(node, event){

27 Oct 2010, 10:14 PM
The API of Ext.tree.TreeNode defines the href attribute, so you could rename the uri attribute to href.
Then you can remove your click listener, because the href attribute should automatically link your TreeNode.

27 Oct 2010, 11:07 PM
thank you for help.
It helps, but just curious how can I get some other parameters via JSON?

27 Oct 2010, 11:32 PM
All properties from the node's JSON definition are put into attributes.


29 Oct 2010, 5:41 AM
thank you very much.