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

Remove Tooltips from Calendar Navigation and Day Heading

5 Answers 132 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Web Developer
Top achievements
Rank 1
Web Developer asked on 25 Feb 2015, 05:17 PM
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


5 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 26 Feb 2015, 02:49 PM
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.

 
0
Web Developer
Top achievements
Rank 1
answered on 26 Feb 2015, 05:20 PM
i have a requirement that has to include the RadtoolTipManager so no i cannot remove it.
0
Marin Bratanov
Telerik team
answered on 26 Feb 2015, 05:56 PM

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.

 
0
Web Developer
Top achievements
Rank 1
answered on 27 Feb 2015, 08:47 PM
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


0
Web Developer
Top achievements
Rank 1
answered on 02 Mar 2015, 04:34 PM
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



Tags
Calendar
Asked by
Web Developer
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Web Developer
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or