EasyUI Forum
May 05, 2024, 02:49:59 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tooltip with condition  (Read 7309 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« on: November 07, 2014, 02:27:02 AM »

Hey, I am trying to build a tooltip for all the the rows in the datagrid, I have managed to do so but I have a problem.
I need to show the tooltip only at some conditions and the problem is that the tooltip does not have something like: 'onBeforeShow'
which then I could easly check my condition and return false if I dont want it to open.

But in his current state I could only put the condition in the 'onShow', but when I hide it in that event you can see the tooltip open and close.
Is there any way to achieve this?

Thanks!
« Last Edit: November 07, 2014, 06:51:32 AM by A-K » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 07, 2014, 08:12:08 AM »

You can move the tip message to the invisible area in the 'onShow' event handler.
Code:
$('#tt').tooltip({
onShow:function(){
if (somecondition){
$(this).tooltip('tip').css({
left:-1000000
})
}
}
})
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #2 on: November 07, 2014, 08:43:22 AM »

Thanks works great!
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!