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
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!
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.
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.
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.