Reputation: 1182
I'd like to create a tooltip when I'm hovering a node on a treepanel, then look through the tree at this node in order to count its leaves and then show the result in the tooltip. At this moment, I can't catch the id of the node, just got the id of the treepanel. (the listeners are part of the treepanel)
listeners: {
afterrender: function( value, eOpts ) {
Ext.create('Ext.tip.ToolTip', {
target: value.getEl(),
listeners: {
beforeshow: function (value, eOpts ) {
treepanel.getRootNode().cascadeBy(function (node) {
// if (node ==
});
view.getEl();
}
}
});
}
}
Is there a way to catch the id of the leaf ?
Upvotes: 0
Views: 3272
Reputation: 5856
If the root of the problem is how to display the tooltip then the easies way is to get a reference to the node and then calling:
node.set('qtip', 'The tip text')
You don't need to go down to the DOM to get element for manually created tooltip target.
Upvotes: 2