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

Manual Closing For Tooltips

9 Answers 230 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Chamira
Top achievements
Rank 1
Chamira asked on 24 Jul 2009, 04:34 AM
whats the coding thats required to close the opened tooltip from an asp.net button.
using the RadToolTipManager

for example.. to give a similar action as ManualClose (X) on the radToolTipManager property.

Thanks

9 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 24 Jul 2009, 08:07 AM
Hello Chamira,

Check out the following example which can be used to hide a tooltip on a button click:
aspx:
 <telerik:RadToolTipManager ID="RadToolTipManager1" Text="Custom RadToolTip Text"  
         HideEvent="FromCode"  runat="server">       
         <TargetControls> 
         <telerik:ToolTipTargetControl TargetControlID="TargetControl" />          
         </TargetControls>   
        </telerik:RadToolTipManager> 
         
        <asp:Button ID="Button1" runat="server" Text="Hide Tooltip" OnClientClick="return CloseToolTip()" /> 

js:
function CloseToolTip()      
    {          
        var controller = Telerik.Web.UI.RadToolTipController.getInstance();   
        var tooltip = controller.get_activeToolTip();     
        if(tooltip) 
         tooltip.hide();   
          
         return false
    }  

Thanks
Princy.
0
Accepted
Svetlina Anati
Telerik team
answered on 24 Jul 2009, 09:50 AM
Hi guys,

Basically, the syntax you use is correct but getting the reference to the active tooltip in this manner is now obsolete. The new syntax do not need to get teh controller but to simplyt use the static getCurrent method as shown below:

function CloseToolTip()         
    {             
    
        var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();    
        if(tooltip)   
        {   
          tooltip.hide();     
        }   
    }     
 



Regards,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
James MacFarlane
Top achievements
Rank 1
answered on 24 Jul 2009, 03:50 PM
I am having problems getting ManualClose to work. I see the DIV in the right place, but no action is performed when clicking on it. No changes to the code have been made as it was working with the pre Q1 2009 version. Does something need to be added for the Q1 2009 version here?

<telerik:radtooltip ID="RadToolTip1" runat="server" Skin="Web20"
            TargetControlID="AnnualReportsTip" Position="TopCenter" ShowEvent="OnClick"
            HideEvent=ManualClose>
            <uc1:AnnualReports ID="AnnualReports1" runat="server" />
        </telerik:radtooltip>
       <asp:HyperLink CssClass="newsLink" ID="AnnualReportsTip" NavigateUrl="/text.aspx" Target="_blank" runat="server">Click here to view selected highlights</asp:HyperLink>
0
Chamira
Top achievements
Rank 1
answered on 27 Jul 2009, 09:04 AM
thanks both of you.. both marked as answers..
once again thanks
0
Svetlina Anati
Telerik team
answered on 27 Jul 2009, 11:00 AM
Hello guys,

Chamira, I am glad I could help in your implementation.

James, I built up a test demo page based on your code but unfortumately I was not able to reproduce the issue - the tooltip hides as expected when I click on the manual close button. I tested the page with both Q1 and Q2 2009 and under IE8 as noted but everything worked as expected.

I attached my tets page to teh thread for your reference, please examine it and let me know if I am missing something and what should I do to reproduce the problem. Once I have a better understanding on the issue I will do my best to help.

Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
James MacFarlane
Top achievements
Rank 1
answered on 30 Jul 2009, 03:09 PM
Here is the page that demonsrates the problem. Click on "Click here to view selected highlights" just under the main image. The Tooltip close button does not work.

http://beta.moveableonline.com/

Thank you.

- James.


0
Svetlina Anati
Telerik team
answered on 04 Aug 2009, 12:09 PM
Hello James,

I examined the provided live url and I was able to reproduce the problem. However, I am afraid that examining the issue online is not enough to find the exact reason for the issue. That is why I would like to kindly ask you to modify the test page I last sent you in order to reproduce the problem and share all the needed source here so that I will be able to directly create a reproduction demo and analyze it on my side. While you are isolating the issue in my test demo, I suggest to disable ajax in your original application and in case this fixes the issue, just replicate the same ajax settings to the test page.

Once I am able to reproduce and investigate the problem locally I will do my best to help.

Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Peter
Top achievements
Rank 1
answered on 21 Jan 2010, 04:57 AM
That was a pretty lame answer.
0
Georgi Tunev
Telerik team
answered on 21 Jan 2010, 08:53 AM
Hi Peter,

I am sorry to see that you didn't like the answer that Svetlina provided, but please note that it was the best that we could give at this time. The code that James sent was working as expected and should not cause a problem as the one that he reported. The beta site in question was quite complex and just by checking the behavior and examining the HTML dump we were not able to pinpoint the reason for the problem.
That is why Svetlina asked for additional details and attached a small sample to this thread which James could check and tell what are the differences between it and his exact setup and logic. We, however haven't received reply from him.

If you experience the same problem, please provide more information about the exact setup and if possible, please rework Svetlina's sample page so it reproduces the problem and send it back to us - we will check it right away and do our best to help.


All the best,
Georgi Tunev
Senior Support
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ToolTip
Asked by
Chamira
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Svetlina Anati
Telerik team
James MacFarlane
Top achievements
Rank 1
Chamira
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or