Jump to content

UNITreeMenu:How to display the total text where the mouse stay on the menu item?


55143681

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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     
    }
}


 

 

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...