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

3 posts, 0 answers
  1. Kevin
    Kevin avatar
    15 posts
    Member since:
    Mar 2013

    Posted 14 Dec 2013 Link to this post

    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. Kevin
    Kevin avatar
    15 posts
    Member since:
    Mar 2013

    Posted 17 Dec 2013 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Plamen
    Admin
    Plamen avatar
    2730 posts

    Posted 18 Dec 2013 Link to this post

    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.
Back to Top