Linda Posted March 14, 2022 Share Posted March 14, 2022 Hi, I'm using the following code to create tooltips on UniTreeview nodes. It works just fine. But I'd like to sometimes only show the tooltip when the user mouses over the icon instead of the whole line. How can I do that? Thanks. NavTree.ClientEvents.ExtEvents.Values['viewready'] := 'function viewready(sender, eOpts) '+ '{ '+ ' sender.view.tip = Ext.create(''Ext.tip.ToolTip'', { '+ ' target: sender.view.el,'+ ' delegate: sender.view.cellSelector, '+ ' trackMouse: true, '+ ' showDelay: 500, '+ ' hideDelay: 10, '+ ' dismissDelay: 0, ' + // since the tip could be long, keep the tooltip up as long as mouse is over ' componentCls: ''overviewTip'', ' + ' renderTo: Ext.getBody(), '+ ' listeners: { '+ ' beforeshow: function updateTipBody(tip) { '+ ' gridColums = sender.view.getGridColumns(); '+ ' column = gridColums[tip.triggerElement.cellIndex]; '+ ' record = sender.view.getRecord(tip.triggerElement.parentNode); '+ ' cellTd = sender.view.getCell(record, tip.triggerElement.cellIndex); ' + ' if (cellTd) { ' + ' cellInnerDiv = cellTd.querySelector(''.x-grid-cell-inner''); ' + ' if (cellTd.hasAttribute("coverview")) { ' + ' tip.update(cellTd.getAttribute("coverview")); }' + ' else ' + ' if ((cellInnerDiv.scrollWidth > cellInnerDiv.offsetWidth) ){' + // ' && cellTd.hasAttribute(''overflow-tooltip'')){ '+ ' tip.update(record.data.text); '+ ' } else { '+ ' return false; '+ ' } '+ ' } ' + // if celltd ' else { '+ ' return false; '+ ' } '+ ' } '+ ' } '+ ' }); ' + '} '; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 14, 2022 Share Posted March 14, 2022 3 hours ago, Linda said: I'm using the following code to create tooltips on UniTreeview nodes. It works just fine. Hello, Sorry, which build of UniGUI are you using? Quote Link to comment Share on other sites More sharing options...
Linda Posted March 14, 2022 Author Share Posted March 14, 2022 1.90.0.1556 I can go to current version if that is needed. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 14, 2022 Share Posted March 14, 2022 15 hours ago, Linda said: NavTree.ClientEvents.ExtEvents.Values['viewready'] := 'function viewready(sender, eOpts) '+ '{ '+ I couldn't reproduce... Can you make a simple testcase? Quote Link to comment Share on other sites More sharing options...
Linda Posted March 14, 2022 Author Share Posted March 14, 2022 Can you just tell me how to detect the mouseover of the icon? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 15, 2022 Share Posted March 15, 2022 15 hours ago, Linda said: Can you just tell me how to detect the mouseover of the icon? I will try to analyze. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 15, 2022 Share Posted March 15, 2022 18 hours ago, Linda said: Can you just tell me how to detect the mouseover of the icon? Hello, A simple example: UniTreeView.ClientEvents.ExtEvents -> function afterrender(sender, eOpts) { sender.getView().tip = Ext.create('Ext.tip.ToolTip', { target: sender.getView().getEl(), delegate: '.x-tree-icon', trackMouse: true, renderTo: Ext.getBody(), listeners: { beforeshow: function updateTipBody(tip) { gridColums = sender.getView().getGridColumns(); column = gridColums[tip.triggerElement.cellIndex]; record = sender.getView().getRecord(tip.triggerElement.parentNode); tip.update(record.data.text); } } }); } Quote Link to comment Share on other sites More sharing options...
Linda Posted March 15, 2022 Author Share Posted March 15, 2022 Thank you very much! I'll check it out. I love your product and this forum has answered many, many questions for m. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.