Context Menu Null Reference

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

    Posted 15 Jul 2014 Link to this post

    I have an interesting, but not funny, situation with the RadScheduler. In a nutshell, I am using context menus for the Appointments and Time Slots. My issue is with the Appointment context menu. Looking at the attached aspx page, you will notice that the data source for the scheduler is controlled by one of the combo boxes. When first entering the page, everything works as expected. However, after changing the selected item on the combobox, the Appointment context menu fails (I believe it is in the showAt method) when the following error is recorded: Unable to get property 'parentNode' of undefined or null reference. This leaves the property, _shown, set to true which means that, the next time you try to open the menu, it thinks it is already open and tries to close it, which also fails.

    The scheduler is defined as:

    <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="EndOn" DataKeyField="ScheduleId"
    DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrentParentId"
    DataSourceID="ScheduleDataSource" DataStartField="StartOn" DataSubjectField="Subject"
    DayStartTime="06:00:00" MinutesPerRow="60" SelectedView="MonthView" StartInsertingInAdvancedForm="True"
    Width="1000px" ShowViewTabs="False" Height="580px"
    OnNavigationCommand="RadScheduler1_NavigationCommand" OnClientFormCreated="OnClientFormCreated"
    ShowFooter="False" RowHeight="20px" OnAppointmentDelete="RadScheduler1_AppointmentDelete"
    OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
    OnClientAppointmentMoveStart="RadScheduler1_AppointmentMoveStart" OnOccurrenceDelete="RadScheduler1_OccurrenceDelete"
    AllowEdit="False" OnFormCreating="RadScheduler1_FormCreating"
    OnClientAppointmentContextMenu="RadScheduler1_AppointmentContextMenu"
    OnClientAppointmentContextMenuItemClicked="RadScheduler1_AppointmentContextMenuItemClicked"
    OnAppointmentDataBound="RadScheduler1_AppointmentDataBound">
    <ExportSettings>
    <Pdf PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" />
    </ExportSettings>
    <AdvancedForm Modal="True" />
    <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>
    <TimeSlotContextMenus>
    <telerik:RadSchedulerContextMenu runat="server" ID="TimeSlotContextMenu">
    <Items>
    <telerik:RadMenuItem Text="New Calendar/Event" Value="CommandAddAppointment" />
    <telerik:RadMenuItem Text="New Recurring Calendar/Event" Value="CommandAddRecurringAppointment" />
    </Items>
    </telerik:RadSchedulerContextMenu>
    </TimeSlotContextMenus>
    <ResourceTypes>
    <telerik:ResourceType DataSourceID="CalendarDataSource" ForeignKeyField="CalendarId"
    KeyField="CalendarId" Name="Calendar" TextField="Name" />
    <telerik:ResourceType DataSourceID="EventDataSource" ForeignKeyField="EventId" KeyField="EventId"
    Name="Event" TextField="Name" />
    </ResourceTypes>
    <Localization ConfirmRecurrenceDeleteSeries="Delete this and all future occurrences." />
    <TimelineView NumberOfSlots="7" />
    <WeekView DayStartTime="06:00:00" />
    <MultiDayView DayStartTime="06:00:00" />
    <MonthView FirstDayHeaderDateFormat="d MMM" />
    </telerik:RadScheduler>

    The data source is defined as:

    <asp:LinqDataSource ID="ScheduleDataSource" runat="server" ContextTypeName="EnterpriseWeb.DataContracts.Scheduling.SchedulingDataContext"
    EntityTypeName="" TableName="ScheduleHeaderRows" EnableDelete="True" EnableInsert="True"
    EnableUpdate="True" Where="GroupID == @GroupID" OnInserting="ScheduleDataSource_Inserting"
    OnUpdated="ScheduleDataSource_Updated">
    <WhereParameters>
    <asp:ControlParameter ControlID="GroupComboBox" DefaultValue="0" Name="GroupId" PropertyName="SelectedValue"
    Type="Int16" />
    </WhereParameters>
    </asp:LinqDataSource>

    The method for opening the menu is:

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

    Unfortunately, I will not be able to provide any data for testing.
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 18 Jul 2014 Link to this post

    Hello,

    I have noticed that you already opened a support ticket for the same problem. I would suggest continuing our communication in #840500 in order to avoid any confusions.

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