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

hide() client api method throws Javascript error

1 Answer 101 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Harsh
Top achievements
Rank 1
Harsh asked on 21 Oct 2007, 07:16 AM
I am trying to control RadToolTip using client side API. When I call hide() method I get 'Object doesn't support this property or method' JavaScript error.
For some reason, when I try to get RadToolTip object either with a $get or $find I get "DIV" object rather than a client Telerik RadToolTip object.

Please help me with this problem. Thanks in advance. Below is my code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<
head id="Head1" runat="server">
<title>Untitled Page</title>
</
head>
<
body >
<form id="form1" runat="server">
<div id="divID">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<
script type="text/javascript">
function hideToolTip()
{
var tooltip = $get("RadToolTip1");
tooltip.hide();
}
</script>

<telerik:RadToolTip ID="RadToolTip1" runat="server"
TargetControlID="link1" IsClientID="true"
Text="Tool Tool Tool" RelativeTo="Mouse"
ShowEvent
="OnClick" ManualClose="true" ></telerik:RadToolTip>
<input type="button" id="b2" name="Hide" value="Hide" onclick="hideToolTip();" />
<a href="#" id="link1">Link</a>
</div>
</form>
</
body>
</
html>

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 23 Oct 2007, 01:56 PM
Hi Harsh,

I believe the same question was addressed in another thread with you, so I will simply paste my answer here as well. I tested it and I noticed that you are using $get to get reference to the tooltip. The difference between $get and $find is that the first one gets reference to the DOM element(DIV in this case) whereas $find gets reference to the JavaScript component. In your case you should use $find. I tested your code with this slight modification and it works correctly. I realize that in your post you mention that either way you got the DOM element but my tests do not prove this. In case your problem persists, please send us step-by-step directions on how to reproduce the issue with this code or another one that actually reproduces it.

Regards,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
Harsh
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or