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

Jquery/Javascript error in Appointment Insert with enter key pressed

3 Answers 106 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Brendan
Top achievements
Rank 1
Brendan asked on 03 Apr 2012, 05:52 PM
Hi,

I am having issues with the radscheduler advanced insert form in my radscheduler. What is happening is whenever I double click an empty timeslot to bring up the insert template, whenever I press the enter key in any of the textboxes of the form, I get a javascript error. It seems like the keypress on enter is causing some sort of event to fire and then I get the unhandled exception.


Here is where I am getting the unhandled exception dynamically created by visual studio
/* START Telerik.Web.UI.Common.jQuery.js */
/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */

g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c

My Radscheduler control:
 <telerik:RadScheduler runat="server" ID="RadScheduler1"
                    AdvancedForm-EnableCustomAttributeEditing="true"
                    CustomAttributeNames="TimeStart, TimeOut"
                    Height="1200px" Width="100%"
                    ShowFooter="False"
                    SelectedDate="2009-02-02" TimeZoneOffset="03:00:00" DayEndTime="20:00:00"                        
                    FirstDayOfWeek="Monday" LastDayOfWeek="Sunday"
                    AppointmentStyleMode="Default"
                    OnNavigationComplete="RadScheduler1_NavigationComplete"
                    OnAppointmentCreated="RadScheduler1_AppointmentCreated"
                    OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
                    OnAppointmentDelete="RadScheduler1_AppointmentDelete"
                    OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
                    OnAppointmentInsert="RadScheduler1_AppointmentInsert"
                    DataDescriptionField="Description" DataEndField="End" DataKeyField="ID"
                    DataRecurrenceField="RecurrenceRule"
                    DataRecurrenceParentKeyField="RecurrenceParentID" DataReminderField="Reminder"
                    DataSourceID="SqlDataSource" DataStartField="Start"
                    DataSubjectField="Subject" DayStartTime="06:00:00"
                    WorkDayEndTime="19:00:00" WorkDayStartTime="06:00:00"
                    onformcreated="RadScheduler1_FormCreated"
                    onformcreating="RadScheduler1_FormCreating"
                    StartInsertingInAdvancedForm="True" AllowDelete="False"
                    SelectedView="WeekView" WeekView-GroupingDirection="Horizontal"
                    ColumnWidth="200px"
                    ShowAllDayRow="true" MinutesPerRow="30" GroupingDirection="Vertical">
                    <AdvancedForm Modal="true" />
                    <TimelineView UserSelectable="false" />
                    <ResourceTypes>
                        <telerik:ResourceType AllowMultipleValues="false" DataSourceID="SqlDataSource1"
                            ForeignKeyField="UserID" KeyField="UserID" Name="Users" TextField="UserName" />
                                          
                    </ResourceTypes>
                    <ResourceStyles>
                        <%--AppointmentStyleMode must be explicitly set to Default (see above) otherwise setting BackColor/BorderColor
                        will switch the appointments to Simple rendering (no rounded corners and gradients)--%>
                        
                        <telerik:ResourceStyleMapping Type="Users" Text="ebarcza" ApplyCssClass="rsCategoryRed" />
                        <telerik:ResourceStyleMapping Type="Users" Text="Sean.Kelly" ApplyCssClass="rsCategoryPink" />
                        <telerik:ResourceStyleMapping Type="Users" Text="RandyPurser" ApplyCssClass="rsCategoryOrange" />
                        <telerik:ResourceStyleMapping Type="Users" Text="jSturm" ApplyCssClass="rsCategoryYellow" />
                        <telerik:ResourceStyleMapping Type="Users" Text="tMichel" ApplyCssClass="rsCategoryBlue" />
                        <telerik:ResourceStyleMapping Type="Users" Text="jDuff" ApplyCssClass="rsCategoryGreen" />
                        <telerik:ResourceStyleMapping Type="Users" Text="JennSturm" ApplyCssClass="rsCategoryViolet" />
                        <telerik:ResourceStyleMapping Type="Users" Text="Tentative" BackColor="red"  />
                        <telerik:ResourceStyleMapping Type="Calendar" Text="Work" BackColor="#edd5b7" BorderColor="#cdb597" />
                    </ResourceStyles>
                    <Reminders Enabled="True" />
                    <AppointmentTemplate>
                        <div class="rsAptSubject" style="font-size:9px; height:50px;">
                            <%# Eval("Subject") %>
                        </div>
                    </AppointmentTemplate>

                    <TimeSlotContextMenuSettings EnableDefault="true" />
                                <DayView DayStartTime="06:00:00" WorkDayStartTime="06:00:00"
                        DayEndTime="20:00:00" WorkDayEndTime="20:00:00" />
                    <MonthView AdaptiveRowHeight="True" VisibleAppointmentsPerDay="10" />
                    <AppointmentContextMenuSettings EnableDefault="true" />
                  
                </telerik:RadScheduler>

I have been unable to narrow down the cause of this error. Any thoughts??

Thanks,

Brendan

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 06 Apr 2012, 02:35 PM
Hi Brandon,

 
I have inspected the issue by creating a sample web site that uses a RadScheduler with the code that you posted bound to a sample XML database. Unfortunately I could not observe the unusual behavior so it seems that it is invoked by the additional code that you are using. Here you can see a video of my test.

I am attaching my test project as well so please let me know what other functionality should be added to it in order to observe the issue locally.

Kind regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Brendan
Top achievements
Rank 1
answered on 11 Apr 2012, 11:02 PM
Sorry for the delay and thank you for your response and efforts. Here is my source code in its entirety from
my Default.aspx page. Again I only get the error on submit form and in IE. I notice when I try to get
the error in firefox that upon hitting the enter key it updates the EndTime timepicker to be a half hour
after the startTime every time and then places the cursor in the first text box of the appointment template.
In IE I only get the javascript error. Maybe that will help.I thank you in advance for your efforts they are greatly appreciated! Do not hesitate to ask for anything else.


<%@ Page Title="Cranes Schedule" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Scheduler._Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<title></title>
<style>
.blue
{
    background-color:cornflowerBlue;
    /*test*/   
}
.red
{
    background-color:#f2d0d0;  
}
.green
{
    background-color:#daf0ca;  
}
.orange
{
    background-color:#f2e0ca;  
}
.darkred
{
    background-color:#7c5555;
}
.yellow
{
    background-color:#fffbc7;  
}
.darkgreen
{
     
}
.violet
{
    background-color:Purple;
}
.pink
{
    background-color:#f1dcff;
}
.darkred
{
     
}
.red
{
    background-color:Red;  
}
.brown
{
    background-color: #a9794a; 
}
 
</style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"></telerik:RadScriptManager>
 
    <script type="text/javascript">
        /* Firefox resize scrollable content */
        function hideScrollableArea(sender, eventArgs) {
            if ($telerik.isFirefox)
                $telerik.$('.rsContentScrollArea').css('overflow', 'hidden');
        }
        function showScrollableArea(sender, eventArgs) {
            if ($telerik.isFirefox)
                $telerik.$('.rsContentScrollArea').css('overflow', 'auto');
        }
 
        
 
    </script>
 
    <telerik:RadAjaxManager runat="Server" ID="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadCalendar1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadCalendar2" />
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadCalendar2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadCalendar1" />
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="chksthompson">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="chkebarcza">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Windows7" />
    <div style="border:1px solid blue;">
        <telerik:RadSplitter runat="server" ID="RadSplitter1" PanesBorderSize="0" Width="100%"
            Height="1220px" Skin="Windows7" >
            <telerik:RadPane runat="Server" ID="leftPane" Width="230px" MinWidth="230" MaxWidth="300" Height="700px"
                Scrolling="None" OnClientResizing="hideScrollableArea" OnClientResized="showScrollableArea"
                OnClientExpanding="hideScrollableArea" OnClientExpanded="showScrollableArea"
                OnClientCollapsing="hideScrollableArea" OnClientCollapsed="showScrollableArea">
                <div class="calendar-title">Calendar</div>
                <div class="calendar-container">
                    <telerik:RadCalendar runat="server" ID="RadCalendar1" Skin="Windows7" AutoPostBack="true"
                        EnableMultiSelect="false" DayNameFormat="FirstTwoLetters" EnableNavigation="true"
                        EnableMonthYearFastNavigation="false" OnSelectionChanged="RadCalendar1_SelectionChanged"
                        OnDefaultViewChanged="RadCalendar1_DefaultViewChanged">
                    </telerik:RadCalendar>
                    <telerik:RadCalendar runat="server" ID="RadCalendar2" Skin="Windows7" AutoPostBack="true"
                        EnableMultiSelect="false" DayNameFormat="FirstTwoLetters" EnableNavigation="false"
                        EnableMonthYearFastNavigation="false" OnSelectionChanged="RadCalendar2_SelectionChanged">
                    </telerik:RadCalendar>
                </div>
                <telerik:RadPanelBar runat="server" Skin="Windows7" ID="PanelBar" Width="219px">
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="Sturm Corp Team" Expanded="True" >
                            <Items>
                                <telerik:RadPanelItem runat="server" Height="500px">
                                    <ItemTemplate>
                                        <div class="rpCheckBoxPanel" >
                                        <asp:CheckBoxList ID="cblUsers" runat="server">
                                                    </asp:CheckBoxList>
                                       <asp:Repeater runat="server" id="rptUsers" DataSourceID="sdsResources">
                                            <ItemTemplate>
                                                <div>
                                                    <asp:checkbox id="chkBox" runat="server" Checked="true" Text='<%# Eval("ResourceDesc")%>'/>
                                                    <span class="<%# Eval("ResourceClass")%>">     </span>
                                                </div>
                                           </ItemTemplate>
                                        </asp:Repeater>
                                        </div>
                                    </ItemTemplate>
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelBar>
            </telerik:RadPane>
            <telerik:RadSplitBar runat="server" ID="RadSplitBar2" CollapseMode="Forward" BackColor="#FF6600" BorderColor="#9900CC" />
            <telerik:RadPane runat="Server" ID="rightPane" Scrolling="Both" Width="100%" BackColor="#FF9900"  Height="1510px">
                <telerik:RadScheduler runat="server" ID="RadScheduler1"
                    AdvancedForm-EnableCustomAttributeEditing="true"
                    CustomAttributeNames="TimeStart, TimeOut"
                    Height="1200px" Width="100%"
                    ShowFooter="False"
                    SelectedDate="2009-02-02" TimeZoneOffset="03:00:00" DayEndTime="20:00:00"                       
                    FirstDayOfWeek="Monday" LastDayOfWeek="Sunday"
                    AppointmentStyleMode="Default"
                    OnNavigationComplete="RadScheduler1_NavigationComplete"
                    OnAppointmentCreated="RadScheduler1_AppointmentCreated"
                    OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
                    OnAppointmentDelete="RadScheduler1_AppointmentDelete"
                    OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
                    OnAppointmentInsert="RadScheduler1_AppointmentInsert"
                    DataDescriptionField="Description" DataEndField="End" DataKeyField="ID"
                    DataRecurrenceField="RecurrenceRule"
                    DataRecurrenceParentKeyField="RecurrenceParentID" DataReminderField="Reminder"
                    DataSourceID="SqlDataSource" DataStartField="Start"
                    DataSubjectField="Subject" DayStartTime="06:00:00"
                    WorkDayEndTime="19:00:00" WorkDayStartTime="06:00:00"
                    onformcreated="RadScheduler1_FormCreated"
                    onformcreating="RadScheduler1_FormCreating"
                    StartInsertingInAdvancedForm="True" 
                    SelectedView="WeekView" WeekView-GroupingDirection="Horizontal"
                    ColumnWidth="200px"
                    ShowAllDayRow="true" MinutesPerRow="30" GroupingDirection="Vertical">
                    <AdvancedForm Modal="true" />
                    <TimelineView UserSelectable="false" />
                    <ResourceTypes>
                        <telerik:ResourceType AllowMultipleValues="false" DataSourceID="SqlDataSource1"
                            ForeignKeyField="UserID" KeyField="UserID" Name="Users" TextField="UserName" />
                                           
                    </ResourceTypes>
                    <ResourceStyles>
                        <%--AppointmentStyleMode must be explicitly set to Default (see above) otherwise setting BackColor/BorderColor
                        will switch the appointments to Simple rendering (no rounded corners and gradients)--%>
                         
                        <telerik:ResourceStyleMapping Type="Users" Text="ebarcza" ApplyCssClass="rsCategoryRed" />
                        <telerik:ResourceStyleMapping Type="Users" Text="Sean.Kelly" ApplyCssClass="rsCategoryPink" />
                        <telerik:ResourceStyleMapping Type="Users" Text="RandyPurser" ApplyCssClass="rsCategoryOrange" />
                        <telerik:ResourceStyleMapping Type="Users" Text="jSturm" ApplyCssClass="rsCategoryYellow" />
                        <telerik:ResourceStyleMapping Type="Users" Text="tMichel" ApplyCssClass="rsCategoryBlue" />
                        <telerik:ResourceStyleMapping Type="Users" Text="jDuff" ApplyCssClass="rsCategoryGreen" />
                        <telerik:ResourceStyleMapping Type="Users" Text="JennSturm" ApplyCssClass="rsCategoryViolet" />
                        <telerik:ResourceStyleMapping Type="Users" Text="Tentative" BackColor="red"  />
                        <telerik:ResourceStyleMapping Type="Users" Text="pbourassa" BackColor="#a9794a"  />
                        <telerik:ResourceStyleMapping Type="Calendar" Text="Work" BackColor="#edd5b7" BorderColor="#cdb597" />
                    </ResourceStyles>
                    <Reminders Enabled="True" />
                    <AppointmentTemplate>
                        <div class="rsAptSubject" style="font-size:9px; height:50px;">
                            <%# Eval("Subject") %>
                        </div>
                    </AppointmentTemplate>
 
                    <TimeSlotContextMenuSettings EnableDefault="true" />
                                <DayView DayStartTime="06:00:00" WorkDayStartTime="06:00:00"
                        DayEndTime="20:00:00" WorkDayEndTime="20:00:00" />
                    <MonthView AdaptiveRowHeight="True" VisibleAppointmentsPerDay="10" />
                    <AppointmentContextMenuSettings EnableDefault="true" />
                    
                </telerik:RadScheduler>
               
              
            </telerik:RadPane>
        </telerik:RadSplitter>
    </div>
 
                 <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                                ConnectionString="<%$ ConnectionStrings:Scheduler %>"
                                SelectCommand="SELECT [UserId], [UserName] FROM [view_resources]">
                 </asp:SqlDataSource>
 
                <asp:SqlDataSource ID="sdsResources" runat="server"
                    ConnectionString="<%$ ConnectionStrings:Scheduler %>"
                    SelectCommand="SELECT [UserId], [UserName], [ResourceClass], [ResourceDesc] FROM [view_resources] where username not IN('ebarcza', 'marie')">
                </asp:SqlDataSource>
              <%--  <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                    ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                    SelectCommand="SELECT CalendarResourceID,Text,ResourceDesc from Resources">
                </asp:SqlDataSource>--%>
 
                <asp:SqlDataSource ID="SqlDataSource" runat="server"
                    ConnectionString="<%$ ConnectionStrings:Scheduler %>"
                    SelectCommand="Select * from Appointments inner join Resources on Appointments.UserID = Resources.UserID"
                    DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @original_ID"
                    InsertCommand="INSERT INTO [Appointments] ([Subject], [Description], [Start], [End], [UserID], [RecurrenceRule], [RecurrenceParentID], [Reminder], [Annotations], [TimeStart], [TimeOut]) VALUES (@Subject, @Description, @Start, @End, cast(@UserID as uniqueidentifier), @RecurrenceRule, @RecurrenceParentID, @Reminder, @Annotations, @TimeStart, @TimeOut)"
                    OldValuesParameterFormatString="original_{0}"
                    UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Description] = @Description, [Start] = @Start, [End] = @End, [UserID] = cast(@UserID as uniqueidentifier), [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Reminder] = @Reminder, [Annotations] = @Annotations, [TimeStart] = @TimeStart, [TimeOut] = @TimeOut WHERE [ID] = @original_ID" >
                    <DeleteParameters>
                        <asp:Parameter Name="original_ID" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Subject" Type="String" />
                        <asp:Parameter Name="Description" Type="String" />
                        <asp:Parameter Name="Start" Type="DateTime" />
                        <asp:Parameter Name="End" Type="DateTime" />
                        <asp:Parameter Name="UserID" Type="Object" />
                        <asp:Parameter Name="RecurrenceRule" Type="String" />
                        <asp:Parameter Name="RecurrenceParentID" Type="Int32" />
                        <asp:Parameter Name="Reminder" Type="String" />
                        <asp:Parameter Name="Annotations" Type="String" />
                        <asp:Parameter Name="TimeStart" Type="String" />
                        <asp:Parameter Name="TimeOut" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Subject" Type="String" />
                        <asp:Parameter Name="Description" Type="String" />
                        <asp:Parameter Name="Start" Type="DateTime" />
                        <asp:Parameter Name="End" Type="DateTime" />
                        <asp:Parameter Name="UserID" Type="Object" />
                        <asp:Parameter Name="RecurrenceRule" Type="String" />
                        <asp:Parameter Name="RecurrenceParentID" Type="Int32" />
                        <asp:Parameter Name="Reminder" Type="String" />
                        <asp:Parameter Name="Annotations" Type="String" />
                        <asp:Parameter Name="original_ID" Type="Int32" />
                        <asp:Parameter Name="TimeStart" Type="String" />
                        <asp:Parameter Name="TimeOut" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
</asp:Content>
0
Plamen
Telerik team
answered on 16 Apr 2012, 03:56 PM
Hello Brendan,

 
I have inspected the code once again but unfortunately again could not reproduce the issue locally. I am attaching the my updated test project again that is based on the code that you posted. Please review it and let me know if it is running properly at you side. If it is working right please try to modify it so that the error can be observed and send us the code that should be added to it so we can inspect the issue locally. 

Kind regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Brendan
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Brendan
Top achievements
Rank 1
Share this question
or