.show() is an undefined method

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    7 posts
    Member since:
    Jul 2008

    Posted 30 Sep 2011 Link to this post

    I get an error when trying to invoke a tooltip that .show() is an undefined method.  The specific code is:

    var tooltip = $find('OrderToolTip');
    tooltip.show();

    I am not using jQuery in the application, so can I use the client-side tool tip API without it?  I've had a tool tip working on another project in the past, which also didn't use jQuery, but I no longer have the code.

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 03 Oct 2011 Link to this post

    Hi Kevin,

    If the RadToolTip is in an INaming container (such as a master page or an update panel) its ID will be changed by the framework and this is a very likely reason why you cannot access it. In order to get the correct ID you would need to obtain if from the server,for example:
    var tooltip = $find('<%=OrderToolTip.ClientID%>');

    Another possible reason is that you are trying to get a reference to the JavaScript object before the control is loaded on the page. This happens in the Sys.Application.Load event and this is the earliest point at which you can reference AJAX-enabled controls. A shortcut to this event is the JavaScript pageLoad() function. If you want the tooltip visible when the page is loaded you can use its VisibleOnPageLoad property and set it to true.

    As for jQuery - our controls internally use jQuery for some of the functionality and therefore output it to the page if needed. This will not impact your own jQuery if you are using it, neither it is required that you add your own.

    Greetings,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top