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

[Solved] Tooltip load on demand doesnot work at all times in Month and Week view

1 Answer 68 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Prava kafle
Top achievements
Rank 1
Prava kafle asked on 12 Aug 2013, 05:32 PM
Hi,

I have a load on demand tool tip for appointments in Radscheduler. Sometimes, these tool tips do not work in Month and Week View.
When I hover over an appointment, it does not fire   "OnClientBeforeShow" client event.

   <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" Animation="Fade"  
                                            HideEvent="LeaveTargetAndToolTip"   OnClientBeforeShow="clientBeforeShow"  AutoTooltipify="true"  OnClientHide="OnClientHide"   > 
                        </telerik:RadToolTipManager>


  //Sets Appointment tooltip 
              function clientBeforeShow(sender, eventArgs) {
                  var height = $telerik.$(sender.get_contentElement())[0].scrollHeight;
                  var width = $telerik.$(sender.get_contentElement())[0].scrollWidth;
                  //PK 07/30/2013  MWF-543 Load on demand tooltip
                  //var contentText =  sender._text;

                 //Donot send request to webservice if tooltip is null and display subject/default text
                 var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
                 if (tooltip == null) {
                     SetToolTipPositionAndText(sender, sender._text);
                     return;
                 }

                  var element = tooltip.get_targetControl();
                  var appt = $find("<%=rsTicketsSchedule.ClientID %>").getAppointmentFromDomElement(element);
                  var apptID = appt.get_id();
                  //Donot send request to webservice if apptID is null and display subject/default text
                   if (apptID == null) {
                       SetToolTipPositionAndText(sender, sender._text);
                      return;
                  }
                  
                  var baseUrl = 'WorkforceServices/RequestHandler.ashx?q=gettooltipforappointment&ApptID=' + apptID;   

             
                  var serviceOptions = {};
                  serviceOptions.url = baseUrl;
                  serviceOptions.data = null;
                  serviceOptions.type = 'POST';
                  serviceOptions.processData = true;
                  serviceOptions.contentType = "application/json";
                  serviceOptions.dataType = 'json';
                  serviceOptions.success = function (result) {
                      var contentText = result.message;
                      SetToolTipPositionAndText(sender,contentText);
                  };
                  serviceOptions.error = function (xhr) {
                      alert(xhr.statusText);
                      SetToolTipPositionAndText(sender, "" );
                  };

                  var workforceServiceProxy = new WorkforceServiceProxy(serviceOptions);
                  workforceServiceProxy.callService();  
              }


Any ideas?

Thanks,
Prava
 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 13 Aug 2013, 03:23 PM
Hello,

I would suggest reviewing our RadScheduler integration demo with the RadToolTip control located here. It demonstrates how you can load your tool tip content via Ajax request from the server or via JavaScript on the client-side. I guess you can take a look at the part when the tool tip is loaded via Ajax request from the server.


Regards,
Boyan Dimitrov
Telerik
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 the blog feed now.
Tags
Scheduler
Asked by
Prava kafle
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or