Scheduler Appointment Context Menu crash

4 posts, 0 answers
  1. Ed
    Ed avatar
    33 posts
    Member since:
    Sep 2012

    Posted 28 May 2014 Link to this post

    I was notified that code (ASP.Net) that has not been touched in months was now broken. We are using the Scheduler to handle the initiation of commands being sent to devices on a regular basis. Up until today, this was working just fine. I brought up the project and ran it in the VS 2012 debugger. Sure enough, when I tried to open the context menu for the appointment, the debugger intercepted a null reference in the javascript file RadContextMenuScripts.js at line 188. this._getContextMenuElement() returns null. I further tested it on Chrome and found the same behavior.

    One interesting point is that the TimeSlotContextMenu works just fine.

    The definition of the AppointmentContextMenu is:
    <AppointmentContextMenus>
    <telerik:RadSchedulerContextMenu runat="server" ID="AppointmentContextMenu">
    <Items>
    <telerik:RadMenuItem Text="Delete" Value="CommandDelete" />
    <telerik:RadMenuItem Text="Execution Summary" Value="Summary" />
    <telerik:RadMenuItem Text="View Commands" Value="Commands" />
    </Items>
    </telerik:RadSchedulerContextMenu>
    </AppointmentContextMenus>

    When the menu is opened, the following code is executed:

    function RadScheduler1_AppointmentContextMenu( sender, args )
    {
    SelectedAppointment = args.get_appointment();
    SelectedDate.val( SelectedAppointment.get_start().format( "MM/dd/yyyy" ) );
    AppointmentContextMenu.show( args.get_domEvent() );
    }

    I traced from the last line and the crash happens when the menu tries to show itself.
    If you would like to view what is happening, let me know and we can get that set-up.
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 02 Jun 2014 Link to this post

    Hello,

    In order to investigate this problem we would need a bit more of your implementation. Could you please share how you are retrieving the appointment context menu object on the client? For example there is already a variable that holds a reference to the appointment context menu client-side object.
    //JavaScirpt
    function RadScheduler1_AppointmentContextMenu( sender, args )
    {
    SelectedAppointment = args.get_appointment();
    SelectedDate.val( SelectedAppointment.get_start().format( "MM/dd/yyyy" ) );
    AppointmentContextMenu.show( args.get_domEvent() );
    }

    Could you please specify whether that RadScheduler1_AppointmentContextMenu function is a handler for the RadScheduler OnClientAppointmentContextMenu or the OnClientAppointmentContextMenuItemClicked event?

    Regards,
    Boyan Dimitrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ed
    Ed avatar
    33 posts
    Member since:
    Sep 2012

    Posted 02 Jun 2014 in reply to Boyan Dimitrov Link to this post

    I am getting the reference to the context menu by:
     AppointmentContextMenu = $find( "<%= AppointmentContextMenu.ClientID %>" );
    It is activated by:
    OnClientAppointmentContextMenu="RadScheduler1_AppointmentContextMenu"
  5. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 05 Jun 2014 Link to this post

    Hello,

    Please try to get the reference to the context menu in the event handler function:
    //JavaScript
    function RadScheduler1_AppointmentContextMenu(sender, args) {
        var AppointmentContextMenu = $find("<%= AppointmentContextMenu.ClientID %>");
        SelectedAppointment = args.get_appointment();
        SelectedDate.val(SelectedAppointment.get_start().format("MM/dd/yyyy"));
        AppointmentContextMenu.show(args.get_domEvent());
    }


    Regards,
    Boyan Dimitrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top