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

Removing tooltips on grid (clientside)

9 Answers 172 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Arthur Rogers
Top achievements
Rank 1
Arthur Rogers asked on 31 Aug 2009, 05:11 PM
I'm binded the result of a wcf service call to a grid on the client side. All good. I'm also trying to put tooltips on various columns in the grid (also clientside). Putting the tooltips on isn't the problem. The problem starts when I go to page 2. The tooltip IDs for page 1 still exist and so the tooltip breaks. So question is how do you remove the tooltips from the tooltipmanager on the clientside. I've seen the way to so this on the server side i.e. RadToolTipManager1.TargetControls.Clear(); But there doesn't seem to be an equivalent on the client side.
Any help would be appreciated.
Thanks

9 Answers, 1 is accepted

Sort by
0
HHalim
Top achievements
Rank 2
answered on 02 Sep 2009, 06:50 PM
I have the same scenario as you, so I opened up a support ticket.

The answer is that RadTooltipManager does not have a clientside clear() method. Telerik provided several workarounds to clear up the old tooltips artifacts, but it's certainly desirable to have a built-in clientside clear().

So, now we have 2 votes from you and I for Telerik to make clientside clear() method.

0
Rumen
Telerik team
answered on 03 Sep 2009, 02:30 PM
Hi guys,

Thank you for your feature request. We logged it in our ToDo list for future consideration.

Arthur, please try the suggestions below, test the demo page attached here and let us know if you need further assistance:

  1. Use a separate RadToolTip and a standard asp Update Panel to get the same functionality as the OnAjaxUpdate loading the tooltip manager offers. If you want to achieve the WebService functionality, you can use our RadXmlHttpPanel control which supports it and set teh desired content to the tooltip. The demos of the controls are available below:

    http://demos.telerik.com/aspnet-ajax/xmlhttppanel/examples/default/defaultcs.aspx
  2. We can also provide you with sample code which disposes the tooltips but we recommend to use the suggestion above instead. However, I prepared for you a simple demo page which shows how to dispose all the tooltips that have been created by the tooltip manager (as far as I understood you want to dispose all of them at once, when changing records, if I am not correct - please use this code as a start point to adjust it to work as you require).

Best regards,
Rumen
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.
0
Richard
Top achievements
Rank 1
answered on 08 Oct 2009, 05:18 PM
Was wondering if I could also get the code
to clear the tooltips on the client side(didn't see it attached to this post)? Thanks!
0
Tsvetie
Telerik team
answered on 09 Oct 2009, 03:41 PM
Hello Richard,
In order to download the demo page, you have to click here.

Kind regards,
Tsvetie
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.
0
n/a
Top achievements
Rank 1
answered on 02 Feb 2010, 05:20 PM
Hi, I have a similar problem, but I want a function to dispose tooltips just for a certain element.  I see the example you posted to dispose all tooltips on the page, and that is somewhat helpful, but I do not want to clear all tooltips.  In essence, I am trying to do the below.

function ShowTooltip(element, text) { 
                var tooltipManager = $find("<%= ttpManager.ClientID %>"); 
                if (!tooltipManager) return;  
                tooltip = tooltipManager.createToolTip(element);  
                tooltip.set_text("<div style='padding: 3px;'>" + text + "</div>");  
                element.onmouseover = null;  
                tooltip.show();  
            } 
            function DisposeTooltip(element) { 
                var tooltipManager = $find("<%= ttpManager.ClientID %>"); 
                if (!tooltipManager) return;  
                var tooltip = tooltipManager.getToolTipByElement(element);  
                if (!tooltip) return;  
                tooltip.hide(); 
                tooltip.dispose(); 
                tooltip = null
                element.onmouseover = null
            } 

0
Paul Reisinger
Top achievements
Rank 2
answered on 04 Feb 2010, 07:20 PM
I would be interested in removing select tooltips as well.
0
Svetlina Anati
Telerik team
answered on 05 Feb 2010, 09:58 AM
Hello guys,

Ari, I examined your code and it seems to be correct. Would you please explain what are the problems you experience with it?

Paul, the direction Ari took is correct, in case he experiences problems we will examine them and you will be able to use this solution.


Greetings,
Svetlina
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
n/a
Top achievements
Rank 1
answered on 05 Feb 2010, 03:44 PM
Unfortunately the problem is intermittent.  Sometimes it will clear the tooltip, but the vast majority of times it will not remove it, and onmouseover it will popup.  Every browser seems to respond similarly.  Have you seen the same in your testing?  
0
Svetlina Anati
Telerik team
answered on 10 Feb 2010, 03:54 PM
Hello Ari,

Would you please share fully runnable source code? As far as I can see from your code it is expected that a tooltip should show on mouse over because of the following line:

tooltip = tooltipManager.createToolTip(element);

There is no condition and thus it will create a new tooltip every time. This means that it is possible that the previous tooltip was disposed and the tooltip which is shown is a newly created one. However, this depends a lot on your logic and where you call this function - that is why I will need to examine a fully runnable page. Provide also explanations of the exact desired and actual result and the differences between them and I will do my best to help.


All the best,
Svetlina
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
ToolTip
Asked by
Arthur Rogers
Top achievements
Rank 1
Answers by
HHalim
Top achievements
Rank 2
Rumen
Telerik team
Richard
Top achievements
Rank 1
Tsvetie
Telerik team
n/a
Top achievements
Rank 1
Paul Reisinger
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or