EasyUI Forum
September 13, 2025, 12:22:40 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tooltips in tree stuck indefinitely when tree updates  (Read 8088 times)
tomb
Newbie
*
Posts: 14


View Profile
« on: September 18, 2014, 01:14:18 PM »

I have a easyui-tree and it's content occasionally gets refreshed, which will cause it to reload it through a 'loadData' call.  Almost as if there was a timer that triggered a 'loadData' call.  This tree also uses a formatter, which creates easyui-tooltips on some of the entries.  This works great until a refresh happens to occur while a tooltip is showing.  In which case it gets stuck on the screen indefinitely.

I tried a few things but haven't managed to fix it yet.  I currently use the following to make the tooltips work:

Code:
onLoadSuccess:function() {
$.parser.parse($(this));
}

And I tried:

Code:
onLoadSuccess:function() {
$(this).find('.tooltip-f').tooltip('destroy');
$.parser.parse($(this));
}

And I also tried calling .find('.tooltip-f').tooltip('destroy'); right before calling 'loadData', but none of these seem to actually get rid of any displaying tooltips.

I'm also worried a little bit about leaking memory/dom objects.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 18, 2014, 08:22:39 PM »

Please try this:
Code:
$('#tt').tree({
formatter:function(node){
return '<span class="t1" title="'+node.text+'">'+node.text+'</span>';
},
loadFilter:function(data){
$(this).find('span.t1').tooltip('destroy');
return data;
},
onLoadSuccess:function(){
$(this).find('span.t1').tooltip();
}
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!