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

AdvancedEditForm Close Button Client Side Event won't fire in Chrome and Firefox

2 Answers 54 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 15 Dec 2013, 02:58 AM
Hi,

I am trying to get a client side event to fire when the close ('X') button is clicked while trying to Create a new appointment in the RadScheduler. My client side event doesn't get called.

Any ideas on how to get this to work?

Here is my client side code.

$telerik.$("#RadScheduler1_Form_AdvancedEditCloseButton").click(function () {
                alert('Clicked');
                InsertCancel();
            });

Insert Cancel is a function I created to do something else. But I can't even get the alert to show anything.
Tried debugging in Chrome but it never stops on this line.

Thanks,
Kevin

2 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 1
answered on 18 Dec 2013, 02:02 AM
I found a solution to this problem. You can handle this on the server side in the RadScheduler_FormCreated event.

You find the AdvancedEditCloseButton control and then add the javascript function to the OnClientClick Event.

This is an example:

LinkButton btn = (LinkButton)e.Container.FindControl("AdvancedEditCloseButton");
                    if (btn != null && btn.CommandName == "Cancel")
                    {
                        btn.OnClientClick = "InsertCancel();";
                    }

Works fine in Chrome and Firefox now.

Kevin
0
Plamen
Telerik team
answered on 18 Dec 2013, 10:40 AM
Hello Kevin,

Thank you for sharing your solution for the issue. Another way to achieve similar behavior would be by using onClientFormCreated event.

Regards,
Plamen
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
Kevin
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or