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

Cancelling a click event

4 Answers 72 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 10 Jun 2008, 02:55 PM
I ahve a button in my appointment template which shows a tooltip using the tooltip manager (from your example)

When I click the button the tooltip appears, which is correct. But when I close the tooltip and then click the button a 2nd time the advanced edit window appears and the tooltip.

How can I prevent the edit window appearing on the 2nd click? Surely if I click the button then the appointment edit window shouldn't appear.

Any help would be great
Jon

4 Answers, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 12 Jun 2008, 07:25 AM
I haven't found anything more about this yet, anyone else?
0
Accepted
T. Tsonev
Telerik team
answered on 12 Jun 2008, 11:17 AM
Hello Jonathan,

As I understand, you have something similar to this in your AppointmentTemplate:

<input type="button" id="button1" value="button1" onclick="javascript:onButtonClick(this, event)" /> 

The click event actually "bubbles up" to the RadScheduler itself and gets processed. This results in the undesired effect that you are experiencing - the appointment goes into edit mode after the second click.

You need to cancel the bubbling in the event handler to prevent this. For example:

function onButtonClick(sender, e) 
    // ... 
 
    $telerik.cancelRawEvent(e); 
 

I suggest that you do the same for the "dblclick" event too. I hope this helps.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jonathan
Top achievements
Rank 1
answered on 12 Jun 2008, 01:35 PM

Hi Tsvetomir

I have this inside my appointmenttemplate

<asp:LinkButton ID="LinkButtonMoreInfo" runat="server" Text="more"> </asp:LinkButton>

In the appointmentcreated event I then have this code

If

(e.Appointment.Visible AndAlso Not IsAppointmentRegisteredForTooltip(e.Appointment)) Then

Dim tttc As New ToolTipTargetControl
tttc.Value =
CInt(e.Appointment.ClientID.Split("_")(1))
tttc.IsClientID =
True
tttc.TargetControlID = linkButton.ClientID
RadToolTipManager1.TargetControls.Add(tttc)

End If

So there isn't a client side click event. Is it possible to cancel the bubbling up of the event when I don't have a click event?

Cheers
Jon

0
Jonathan
Top achievements
Rank 1
answered on 12 Jun 2008, 01:39 PM
Ok no worries I've figured it out. Simple in the end

OnClientClick

="onButtonClick(this, event);"

Cheers for your help

Jon

Tags
Scheduler
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Jonathan
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or