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

Error on JavaScript when using Get_appointment

2 Answers 61 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
KobusVisagie
Top achievements
Rank 1
KobusVisagie asked on 12 Nov 2010, 11:15 AM
Hi

Can anyone please help me, i'm strugeling with this for a while now. i get this error when executing a piece of javascript

Error : Microsoft JScript runtime error: Object doesn't support this property or method

I am using the basic example in telerik tv to create the appointment, there is no problem up untill where i call the event "AppointmentContextClicked".

It throws an exception when it hits var selectedApt = eventArgs.Get_appointment().get_subject();

Source is below


<%@ Page Title="" Language="C#" MasterPageFile="-----------------" AutoEventWireup="true"
    CodeBehind="---------------" Inherits="---------------------" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<telerik:RadCodeBlock runat="server">
<script type="text/javascript">
    //<![CDATA[
    function AppointmentContextClicked(sender, eventArgs) {
        var selectedApt = eventArgs.Get_appointment().get_subject();
        document.getElementById("Text1").value = selectedApt;
    }
    //]]>
    </script>
</telerik:RadCodeBlock>
      
    <input id="Text1" type="text" />
    <telerik:RadScheduler ID="RadScheduler1" runat="server" DataDescriptionField="Body"
        DataEndField="End" DataKeyField="IDDatabaseAppointments" DataSourceID="SchedularDS"
        DataStartField="Start" DataSubjectField="Subject" EnableDescriptionField="True"
        Height="" Skin="Windows7" DataReminderField="Reminder" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
        EnableExactTimeRendering="true" AppointmentStyleMode="Default" AdvancedForm-Modal="true"
        OnClientAppointmentContextMenuItemClicked="AppointmentContextClicked">
        <Reminders Enabled="True" />
        <AppointmentContextMenuSettings EnableDefault="true" />
        <AppointmentContextMenus>
            <telerik:RadSchedulerContextMenu>
                <Items>
                    <telerik:RadMenuItem Text="Hello" />
                </Items>
            </telerik:RadSchedulerContextMenu>
        </AppointmentContextMenus>
        <TimeSlotContextMenus>
        </TimeSlotContextMenus>
    </telerik:RadScheduler>
    <asp:SqlDataSource ID="SchedularDS" runat="server" ConnectionString="<%$ ConnectionStrings:Serv Environment %>"
        DeleteCommand="DELETE FROM [DatabaseAppointment] WHERE [IDDatabaseAppointments] = @IDDatabaseAppointments"
        InsertCommand="INSERT INTO [DatabaseAppointment] ([Subject], [Body], [Start], [End], [IsAllDayEvent], [Location], [Url], [Type], [RecurrencePattern], [TimeZoneString], [Developer], [Productline], [ExceptionAppointments], [Importance], [TimeMarker], [Category], [UserID], [Reminder], [PageType]) VALUES (@Subject, @Body, @Start, @End, @IsAllDayEvent, @Location, @Url, @Type, @RecurrencePattern, @TimeZoneString, @Developer, @Productline, @ExceptionAppointments, @Importance, @TimeMarker, @Category, @UserID, @Reminder, @PageType)"
        SelectCommand="Dairy_LoadSchedules" UpdateCommand="UPDATE [DatabaseAppointment] SET [Subject] = @Subject, [Body] = @Body, [Start] = @Start, [End] = @End, [IsAllDayEvent] = @IsAllDayEvent, [Location] = @Location, [Url] = @Url, [Type] = @Type, [RecurrencePattern] = @RecurrencePattern, [TimeZoneString] = @TimeZoneString, [Developer] = @Developer, [Productline] = @Productline, [ExceptionAppointments] = @ExceptionAppointments, [Importance] = @Importance, [TimeMarker] = @TimeMarker, [Category] = @Category, [UserID] = @UserID, [Reminder] = @Reminder, [PageType] = @PageType WHERE [IDDatabaseAppointments] = @IDDatabaseAppointments"
        SelectCommandType="StoredProcedure">
        <DeleteParameters>
            <asp:Parameter Name="IDDatabaseAppointments" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Subject" Type="String" />
            <asp:Parameter Name="Body" Type="String" />
            <asp:Parameter Name="Start" Type="DateTime" />
            <asp:Parameter Name="End" Type="DateTime" />
            <asp:Parameter Name="IsAllDayEvent" Type="Boolean" />
            <asp:Parameter Name="Location" Type="String" />
            <asp:Parameter Name="Url" Type="String" />
            <asp:Parameter Name="Type" Type="Int32" />
            <asp:Parameter Name="RecurrencePattern" Type="String" />
            <asp:Parameter Name="TimeZoneString" Type="String" />
            <asp:Parameter Name="Developer" Type="String" />
            <asp:Parameter Name="Productline" Type="String" />
            <asp:Parameter Name="ExceptionAppointments" Type="String" />
            <asp:Parameter Name="Importance" Type="String" />
            <asp:Parameter Name="TimeMarker" Type="String" />
            <asp:Parameter Name="Category" Type="String" />
            <asp:Parameter Name="UserID" Type="Decimal" />
            <asp:Parameter Name="Reminder" Type="String" />
            <asp:Parameter Name="PageType" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="UserLevel" SessionField="ChartLevel"
                Type="Decimal" />
            <asp:SessionParameter DefaultValue="0" Name="UserID" SessionField="UserID" Type="Decimal" />
            <asp:QueryStringParameter DefaultValue="" Name="PageType" QueryStringField="Type"
                Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Subject" Type="String" />
            <asp:Parameter Name="Body" Type="String" />
            <asp:Parameter Name="Start" Type="DateTime" />
            <asp:Parameter Name="End" Type="DateTime" />
            <asp:Parameter Name="IsAllDayEvent" Type="Boolean" />
            <asp:Parameter Name="Location" Type="String" />
            <asp:Parameter Name="Url" Type="String" />
            <asp:Parameter Name="Type" Type="Int32" />
            <asp:Parameter Name="RecurrencePattern" Type="String" />
            <asp:Parameter Name="TimeZoneString" Type="String" />
            <asp:Parameter Name="Developer" Type="String" />
            <asp:Parameter Name="Productline" Type="String" />
            <asp:Parameter Name="ExceptionAppointments" Type="String" />
            <asp:Parameter Name="Importance" Type="String" />
            <asp:Parameter Name="TimeMarker" Type="String" />
            <asp:Parameter Name="Category" Type="String" />
            <asp:Parameter Name="UserID" Type="Decimal" />
            <asp:Parameter Name="Reminder" Type="String"></asp:Parameter>
            <asp:Parameter Name="PageType" Type="String" />
            <asp:Parameter Name="IDDatabaseAppointments" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

Regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 15 Nov 2010, 03:24 PM
Hi Gregory,

Please note that javascript is case-sensitive - the correct method is get_appointment(), not Get_appointment() as described here.

All the best,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
KobusVisagie
Top achievements
Rank 1
answered on 17 Nov 2010, 02:25 PM
Hi Yana

Thank u,
It is wierd my documentation gives it like this -> Get_appointment
But it works now thank u
Tags
Scheduler
Asked by
KobusVisagie
Top achievements
Rank 1
Answers by
Yana
Telerik team
KobusVisagie
Top achievements
Rank 1
Share this question
or