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

[Solved] Question related to the "Scheduler / Using RadToolTip" demo example

5 Answers 115 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Greg Mercer
Top achievements
Rank 1
Greg Mercer asked on 27 Jan 2010, 01:15 AM
Can the approach shown in the "Scheduler / Using RadToolTip" demo example be used with a RadScheduler control that is getting it's data using a WebService?

I've tried setting up the following:

    <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional"
    <ContentTemplate> 
     
        <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="WeekView" SelectedDate="2009-02-02" 
            TimeZoneOffset="03:00:00"  
            StartEditingInAdvancedForm="false"  
            EnableCustomAttributeEditing="false"  
            OnClientAppointmentsPopulating="initRadScheduler" 
            OnClientAppointmentsPopulated="appointmentsLoaded"  
            OnClientAppointmentDataBound="appointmentDataBound"  
            OnClientAppointmentMoveEnd="appointmentMoveEnd"  
            OnClientAppointmentMoving="appointmentMoving"
            <WebServiceSettings Path="SchedulerWebService.asmx" ResourcePopulationMode="ServerSide" /> 
        </telerik:RadScheduler> 
         
        <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="320" Height="210" 
            Animation="None"  
            HideEvent="LeaveToolTip"  
            Text="Loading..."  
            RelativeTo="Element" 
            OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"  
            OnClientBeforeShow="clientBeforeShow"/>        
 
    </ContentTemplate> 
    </asp:UpdatePanel> 
 

But I never seem to get a call to RadToolTipManager1_AjaxUpdate.

Thanks,
Greg


5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 27 Jan 2010, 01:38 PM
Hi Greg,

This demo you refer to is intended to be used strictly with server side binding of RadScheduler. Probably you can use the following RadTooltip demo for your case:
http://demos.telerik.com/aspnet-ajax/tooltip/examples/radtooltipmanagerclientapi/defaultcs.aspx


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Greg Mercer
Top achievements
Rank 1
answered on 27 Jan 2010, 05:46 PM
Hi Peter,

Thanks for the quick reply.

How would I discover when the mouse was moving over appointment or out of an appointment?

It looks like I would needed to know that, so that I can call a method similar to the showToolTip() method shown in the example.

I've looked though the online docs but don't see anything that looks like it would tell me when these events are occurring.

I could attempt to use jquery to find the appointments and wire up the event handling myself, but if I do that I would need to rebind the event handlers each time appointments become new dom elements in the display of the scheduler. So that leads to another question -  what client event would be the best to tell me when an appointment has become a new dom element and would need to be bound to the mousemove and mouseout event handling?

Also - is there a way to prevent the default (yellow) tooltip from displaying?

Thanks,
Greg


0
Peter
Telerik team
answered on 28 Jan 2010, 03:43 PM
Hello Greg,

You can create the tooltip on hover of the appointment:
function OnClientAppointmentCreated(sender, eventArgs) { 
        eventArgs.get_appointment().get_element().onmouseover = function() { 
    
        var target = eventArgs.get_appointment().get_element(); 
        var tooltipManager = $find("<%= RadToolTipManager1.ClientID %>"); 
    
        //If the user hovers the image before the page has loaded, there is no manager created 
        if (!tooltipManager) return
    
        //Find the tooltip for this element if it has been created  
        var tooltip = tooltipManager.getToolTipByElement(target); 
        //Create a tooltip if no tooltip exists for such element  
        if (!tooltip) { 
            tooltip = tooltipManager.createToolTip(target); 
    
            tooltip.set_value(eventArgs.get_appointment().get_id().toString()); 
               
        
    
        //Let the tooltip's own show mechanism take over from here - execute the onmouseover just once 
        target.onclick = null
        //show the tooltip 
        tooltip.show(); 
        }; 
    }

Since there is no OnClientApointmentOver event, we handle OnClientAppointmentCreated and attach on onmouseover of the appointment's element.

In similar way you can attach on mouseout:

eventArgs.get_appointment().get_element().onmouseout = function() { ...}

Feel free to contact us if you have further questions.


All the best,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Peter
Telerik team
answered on 28 Jan 2010, 03:50 PM

You can remove the default tooltip with the following code:

function OnClientAppointmentCreated(sender, eventArgs) {
               eventArgs.get_appointment().set_toolTip('');
               
           }



Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Greg Mercer
Top achievements
Rank 1
answered on 28 Jan 2010, 05:42 PM
Hi Peter,

Thanks again for your fast response, and thanks very much for all your help. I really appreciate it.

Both of your replies worked great. Just what I needed.

Greg
Tags
Scheduler
Asked by
Greg Mercer
Top achievements
Rank 1
Answers by
Peter
Telerik team
Greg Mercer
Top achievements
Rank 1
Share this question
or