This is a migrated thread and some comments may be shown as answers.

Two Independent RadToolTpManagers

4 Answers 53 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Thomas Kristensen
Top achievements
Rank 1
Thomas Kristensen asked on 06 Oct 2008, 07:03 AM
Hi

I have two ToolTipManagers on a page, lets call them "A" and "B".

When I open a ToolTip from "A", having the manual close property set to True, it still closes automatic when I open a ToolTip from "B", really strange, as each manager have their own "div" area when I inspect the HTML code.

If this is the expected behaviour, I would suggest the possibility to have more than one manager on a page that can interact total independent of the other managers on that page. This just gives much more flexibility.

Best Regards
Thomas Kristensen

4 Answers, 1 is accepted

Sort by
0
Thomas Kristensen
Top achievements
Rank 1
answered on 06 Oct 2008, 03:19 PM
Came a step further using this. 

function

clientBeforeHide(sender, eventArgs){

 

eventArgs.set_cancel(

true);

 

}

Now the Window stays open, so now I just need to figure out a way to close it if clicking the close button of the window!

0
Tervel
Telerik team
answered on 09 Oct 2008, 12:47 PM
Hello Thomas,

RadToolTip(Manager) is designed to only allow one visible tooltip at any given time. This is how browser tooltips behave - and this is generally the idea behind a tooltip.
It is true however, that the control is being used in a much wider variety of scenarios where it can act as a popup, as a dropdown, or as a full-blown panel. Your suggestion makes sense for such scenario, and we added it to our TODO list.

As for detecting whether the tooltip's close button was clicked, one way to do it would be to get a reference to the actual close element and attach an event handler to it, e.g.

function OnClientShow(sender, eventArgs)
{

     var popup = sender.get_popupElement();
  var closeButton = $telerik.getElementByClassName(popup, "CloseButton", "A");
  closeButton.onclick = function() { alert("I was clicked"); }

}



Best regards,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Thomas Kristensen
Top achievements
Rank 1
answered on 09 Oct 2008, 02:18 PM
Hi

Thanks for the answer, however I do not see anything about "get_popupElement" in the documentation, nor does your example close the window. How do I get a reference to the ToolTip, so I can close it? I want to close the ToolTip, not an alert box.
0
Thomas Kristensen
Top achievements
Rank 1
answered on 09 Oct 2008, 05:55 PM
Hi

Figured it out:

function clientBeforeHide(sender, eventArgs){


    if (sender.get_manualClose() == true) {eventArgs.set_cancel(true);} 
    else {eventArgs.set_cancel(false);}
}

 

function OnClientShow(sender, eventArgs){

 

 

var popup = sender.get_popupElement();
var closeButton = $telerik.getElementByClassName(popup, "CloseButton", "A");
 
closeButton.onclick = function() {sender.set_manualClose(false);}
}

 

This did the trick, so now the ToolTip only close when I click the close button, and not when another ToolTip from another managerr is closing.

Tags
ToolTip
Asked by
Thomas Kristensen
Top achievements
Rank 1
Answers by
Thomas Kristensen
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or