-
9 Aug 2012 7:01 PM #1
Answered: how to get node's id & text of a treepanel
Answered: how to get node's id & text of a treepanel
Hi all,
I can get id and text of the node when I expand a node in a treepanel. The code added to listeners like this:
listeners: { itemexpand: function(node) { alert( node.get('id') + node.get('text') ); } }
It runs ok. How can I get id and text of the node WHEN I CLICK a node? The code below does not work:
listeners: { itemclick: function(node) { alert( node.get('id') + node.get('text') ); } }
Any help will be appreciated.
-
Best Answer Posted by vietits
With TreePanel "itemclick" event handler, the first argument is Ext.view.View object, not node object. Try this:
Code:listeners: { itemclick: function(view, node) { alert( node.get('id') + node.get('text') ); ...
-
9 Aug 2012 7:31 PM #2
With TreePanel "itemclick" event handler, the first argument is Ext.view.View object, not node object. Try this:
Code:listeners: { itemclick: function(view, node) { alert( node.get('id') + node.get('text') ); ...
-
9 Aug 2012 8:17 PM #3
Thank you very much. It works!


Reply With Quote