Remove Tooltips from Calendar Navigation and Day Heading

7 posts, 0 answers
  1. Web Developer
    Web Developer avatar
    8 posts
    Member since:
    Nov 2008

    Posted 25 Feb 2015 Link to this post

    I have seen and tried this code that is floating around using this code bit:

    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">    
    <Calendar runat="server" ShowDayCellToolTips="false">        
    <ClientEvents OnLoad="calendarLoad" />    
    </Calendar>
    </telerik:RadDatePicker>

    function calendarLoad(sender, args) {    
    $(sender.get_element()).find("[title]").each(function (i, el)
     {        
    el.title = "";    });

    }

    however when i use this code, it DOES remove the title text, but the tooltip still shows up blank. we have deployed the RadTooltipManager in our Master Page. is there some way to mute these blank tooltips from the calendar? is there no setting like ShowDayCellToolTips="false" for the day cells that apply to the navigation and Day of the Week titles?
    this is very frustrating. any help would be GREATLY appreciated

    thanks in Advance


  2. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 26 Feb 2015 Link to this post

    Hi,

    Does the approach work on a page without a RadTooltipManager?

    Looking forward to hearing from you.


    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Web Developer
    Web Developer avatar
    8 posts
    Member since:
    Nov 2008

    Posted 26 Feb 2015 in reply to Eyup Link to this post

    i have a requirement that has to include the RadtoolTipManager so no i cannot remove it.
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 26 Feb 2015 Link to this post

    Hi,

    When the AutoTooltipify feature of the tooltip manager is enabled, it attaches event handlers to all elements with a title attribute as soon as it initializes. This is during the Sys.Application.Init phase (and event).

    Using the OnLoad event of the calenar (or any other similar control) cannot guarantee that the tooltip manager has not initialized yet and has not attached those handlers. Thus, RadToolTips attempt to show up when the elements are hovered, but since their title attribute is no longer there, the tooltips are blank.

    What I can suggest is the following:

    • Use an earlier event to remove title attributes (e.g., the document.ready jQuery event). You can access the datepicker through its class, for example, instead of using the sender reference.
    • Use the OnClientBeforeShow event of the tooltips to cancel it when your conditions are met (e.g., the tooltip has no text, a certain condition is met for its target, etc.). This could be a more generic approach but it would require some investigation on your end so you can find the exact conditions and checks in order to achieve the functionality you desire.

    As you can see there is no really straightforward way to do this, because AutoTooltipify is a really simple feature. It provides a lot of automation, but this comes at the price of less customization options.

    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Web Developer
    Web Developer avatar
    8 posts
    Member since:
    Nov 2008

    Posted 26 Feb 2015 in reply to Marin Bratanov Link to this post

    hi Marin

    thanks for your answer. it seems there are so many requests for this that i have found on Google Search,  i wonder why Telerik did not already include an attribute for controls like "AutoToolTipifyIgnore = true" for some controls in the way Telerik provided a ShowDayCellToolTips="false". frankly the tooltips on the navigation and day titles seems a little frivolous to me and is of no use, i hope Telerik will consider a modification to this control soon.

    As for your answer, i think what you are saying is a little above my paygrade? can you link some examples of that code some where that i may review it and see what works best?

    thanks for your help

    Eddie B.
  7. Web Developer
    Web Developer avatar
    8 posts
    Member since:
    Nov 2008

    Posted 27 Feb 2015 in reply to Marin Bratanov Link to this post

    I am trying to do this:

    try {
    var DOB = $find(ctl00_ContentPlaceHolderBody_RadDatePickerDOB_calendar);
    DOB.Disabletooltip();
    $(DOB.get_element()).find("[title]").each(function (i, el) {
    el.title = "";
    });


    But i keep getting an Undefined error.

    what am i doing wrong?
    I have this on the document.Ready() function 
    but doesnt seem to work, any help greatly appreciated


  8. Web Developer
    Web Developer avatar
    8 posts
    Member since:
    Nov 2008

    Posted 02 Mar 2015 Link to this post

    For any one looking for this solution, this worked for me:
    Add this function to your page that contains the RadTooltipManager:
    function OnClientBeforeShow(sender, args){    
    if(sender.get_targetControlID().indexOf("RadDatePicker1")!= - 1)    {       
     args.set_cancel(true);    
    }}

    In the RadTooltipManager Attributes, add the following:
    OnClientBeforeShow="OnClientBeforeShow"

    my application has all these items in a Master Page, it is working and i see no tooltips for the calendar


    Hope that is helpful



Back to Top
UI for ASP.NET Ajax is Ready for VS 2017