Sherzod Posted August 31, 2022 Share Posted August 31, 2022 Hello, 10 hours ago, picyka said: I have some rules there that prevent it from working, can you help me? 9 hours ago, picyka said: Testing better here, it doesn't work as expected, it would be nice if you know that the menu has... ? Describe the question in general, what you want to achieve. Quote Link to comment Share on other sites More sharing options...
picyka Posted August 31, 2022 Share Posted August 31, 2022 In my case here, sometimes I have the scrollbar active, I would have to know that it is active and discount the width of the menu Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2022 Share Posted August 31, 2022 2 hours ago, picyka said: I would have to know that it is active and discount the width of the menu Sorry, not very clear. Quote Link to comment Share on other sites More sharing options...
picyka Posted August 31, 2022 Share Posted August 31, 2022 Dois minutos atrás, Sherzod disse: Desculpe, não muito claro. tWidth += (50 * node.data.depth); tWidthMenu = _this.treePanel.getWidth(); if _this.treePanel.scrollBarIsVisible { tWidthMenu -= 15 } if (tWidth > tWidthMenu) { _this.treePanel.getItem(node).el.dom.setAttribute('data-qtip', node.data.text); } I need to know if the scroolBar is visible, because if it were visible, the width of the menu would be smaller. I made an example code, I don't know if there's a way to know if the scroll is visible Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2022 Share Posted August 31, 2022 1 hour ago, picyka said: I don't know if there's a way to know if the scroll is visible Yes. It's possible. I will check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2022 Share Posted August 31, 2022 UniTreeMenu.ClientEvents.UniEvents -> function afterCreate(sender) { sender.isScfrollVisible = function() { return sender.treeMenu.getEl().getHeight() !== sender.treeMenu.getEl().dom.scrollHeight } } Quote Link to comment Share on other sites More sharing options...
picyka Posted August 31, 2022 Share Posted August 31, 2022 44 minutes ago, Sherzod said: sender.isScfrollVisible = function() { function store.nodeappend(sender, node, index, eOpts) { var _this=this; this.treePanel.getItem(node).el.on('mouseover', function() { textMetrics = new Ext.util.TextMetrics(); tWidth = textMetrics.getWidth(node.data.text); tWidth += (35 * node.data.depth); tWidthMenu = _this.treePanel.getWidth(); if (_this.treePanel.getEl().getHeight() !== _this.treePanel.getEl().dom.scrollHeight) { tWidthMenu -= 40; } if (tWidth > tWidthMenu) { _this.treePanel.getItem(node).el.dom.setAttribute('data-qtip', node.data.text); } }); this.treePanel.getItem(node).el.on('mouseout', function() { _this.treePanel.getItem(node).el.dom.setAttribute('data-qtip', ''); }); } It was like this. For me to understand, in your code you are introducing a function in the obj TreeMenu? function afterCreate(sender) { sender.isScfrollVisible = function() { return sender.treeMenu.getEl().getHeight() !== sender.treeMenu.getEl().dom.scrollHeight } } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2022 Share Posted August 31, 2022 1 minute ago, picyka said: For me to understand, in your code you are introducing a function in the obj TreeMenu? 2 minutes ago, picyka said: sender.isScfrollVisible For UniTreeMenu. 1 Quote Link to comment Share on other sites More sharing options...
Muhammad Idris Posted December 1, 2022 Share Posted December 1, 2022 On 7/27/2021 at 6:00 PM, 风吹小机机 said: As shown in the figure excuse me sir, how to make search for treemenu like this ? 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.