I saw some suggestions on how to add a tooltip to the Dojo Tree node, and some of them don't seem to work, while others ask me other questions ...
One of the ways I've tried with limited success is this:
var myTree = new dijit.Tree({ model: treeModel, id: "myTree", showRoot: false, persist: false, onClick: function(item){ console.log(item.name); }, _onNodeMouseEnter : function(node, evt){ var tip = new dijit.Tooltip({ label: node.item.name, connectId: [node.domNode.id] }); } });
But it has odd behavior when creating a tooltip when approaching the node above in the tree and only when hovering over the extension from the top edge ...
The second attempt, I looked at the Tree onMouseEnter method, but it does not have access to the node data element, and so I would have to go through what seems a little logical to get the element data ... by looking at the current node id through the DOM tree navigation, and then look for this item in the store? ...
Finally, I found that there is a getTooltip (item) 'method on the tree, but when I installed it:
var myTree = new dijit.Tree({ model: treeModel, id: "myTree", showRoot: false, persist: false, onClick: function(item){ console.log(item.Obi_Id); }, getTooltip: function(item){ return item.Secondary_Names; } });
the tooltip is just a regular HTML header title popup ...
What is the correct (simple) way to do Dojo hints on dynamic (lazy) tree nodes? -robbie
dojo tooltip tree
Robbie
source share