-
3 Jan 2013 9:25 AM #1
Answered: Tooltip on Tree parentNode
Answered: Tooltip on Tree parentNode
the reqular data-qtip does work on my treepanel... but it shows up on all leafs too. How to check if the mouseover is on the parentNode... I am doing this on the listener of treePanel... is there a method that has isParentNode = true... that way I can just hide or show the tooltip accordingly
-
Best Answer Posted by slemmon
Add a listener to your tree like this:
The second param passed is the record (nodeInterface).Code:listeners: { itemmouseenter: function (view, rec) { console.log(rec.isLeaf()); } }
example:
Code:var store = Ext.create('Ext.data.TreeStore', { root: { expanded: true, children: [ { text: "detention", leaf: true }, { text: "homework", expanded: true, children: [ { text: "book report", leaf: true }, { text: "alegrbra", leaf: true} ] }, { text: "buy lottery tickets", leaf: true } ] } }); Ext.create('Ext.tree.Panel', { title: 'Simple Tree', width: 200, height: 150, store: store, rootVisible: false, renderTo: Ext.getBody() , listeners: { itemmouseenter: function (view, rec) { console.log(rec.isLeaf()); } } });
-
3 Jan 2013 10:43 AM #2
-
3 Jan 2013 11:13 AM #3
I was thinking the same, but how do we get the value in itemmouseover
I am doing this and it's giving me an errorCode:itemmouseenter: function (e, t) { var v = Ext.getCmp('myTree').isleaf(); console.log(v); }
-
3 Jan 2013 11:19 AM #4
Add a listener to your tree like this:
The second param passed is the record (nodeInterface).Code:listeners: { itemmouseenter: function (view, rec) { console.log(rec.isLeaf()); } }
example:
Code:var store = Ext.create('Ext.data.TreeStore', { root: { expanded: true, children: [ { text: "detention", leaf: true }, { text: "homework", expanded: true, children: [ { text: "book report", leaf: true }, { text: "alegrbra", leaf: true} ] }, { text: "buy lottery tickets", leaf: true } ] } }); Ext.create('Ext.tree.Panel', { title: 'Simple Tree', width: 200, height: 150, store: store, rootVisible: false, renderTo: Ext.getBody() , listeners: { itemmouseenter: function (view, rec) { console.log(rec.isLeaf()); } } });
-
3 Jan 2013 11:37 AM #5


Reply With Quote
... thank you slemmon... you are aweome