Error on JavaScript when using Get_appointment

3 posts, 1 answers
  1. Gregory
    Gregory avatar
    47 posts
    Member since:
    Sep 2010

    Posted 12 Nov 2010 Link to this post

    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. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 15 Nov 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gregory
    Gregory avatar
    47 posts
    Member since:
    Sep 2010

    Posted 17 Nov 2010 Link to this post

    Hi Yana

    Thank u,
    It is wierd my documentation gives it like this -> Get_appointment
    But it works now thank u
Back to Top