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

Scheduler Appointment Context Menu crash

3 Answers 72 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 28 May 2014, 05:59 PM
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.

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 02 Jun 2014, 12:48 PM
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.

 
0
Ed
Top achievements
Rank 1
answered on 02 Jun 2014, 01:14 PM
I am getting the reference to the context menu by:
 AppointmentContextMenu = $find( "<%= AppointmentContextMenu.ClientID %>" );
It is activated by:
OnClientAppointmentContextMenu="RadScheduler1_AppointmentContextMenu"
0
Boyan Dimitrov
Telerik team
answered on 05 Jun 2014, 08:30 AM
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.

 
Tags
Scheduler
Asked by
Ed
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Ed
Top achievements
Rank 1
Share this question
or