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

Can't delete an appointment - javascript error before confirmation display

10 Answers 101 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Stuart Watton
Top achievements
Rank 2
Stuart Watton asked on 17 Oct 2010, 11:46 AM
Hi,

I have a RadScheduler on a page and when I try to delete an appointment by either clicking on the little red cross, or right click on the appointment and select delete from the context sensitive menu I get a javascript error in the Telerik javascript generated code saying 
"Object doesn't support this property or method" at the line 
var l=$telerik.$.modal("#"+this.get_element().id+">.rsTopWrap")

This is happening at the confirm delete check in the code

I have checked the value of this.get_element().id and it is returning "RadScheduler1"

Is this a bug in the telerik code or have I done something that would cause this?
My Scheduler is set up as follows and I am using the version from Q2 2010 under ASP.Net 3.5

<telerik:RadScheduler ID="RadScheduler1" runat="server" ShowFooter="false" SelectedDate="2010-10-12"
                                    TimeZoneOffset="00:00:00" DayStartTime="00:00:00" DayEndTime="23:59:59" WorkDayStartTime="08:00:00"
                                    WorkDayEndTime="18:00:00" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableDescriptionField="true"
                                    ShowAllDayRow="false" AppointmentStyleMode="Default" OnNavigationComplete="RadScheduler1_NavigationComplete"
                                    OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" OnAppointmentDelete="RadScheduler1_AppointmentDelete"
                                    OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
                                    onResourceHeaderCreated="RadScheduler1_ResourceHeaderCreated" ShowNavigationPane="true"
                                    OnFormCreating="RadScheduler1_FormCreating" StartEditingInAdvancedForm="false" 
                                    EnableDatePicker="true" MinutesPerRow="30" DataSourceID="LinqDataSource2" DataKeyField="BookingInReference"
                                    DataSubjectField="BookingSubject" DataStartField="StartDate" DataEndField="EndDate"
                                    DataDescriptionField="BookingDetails" Style="position: absolute; top: 215px;
                                    left: 300px; height: 524px;">
                                    <AdvancedForm Modal="true" />
                                    <ResourceTypes>
                                        <telerik:ResourceType KeyField="MachineID" Name="Machine" TextField="MachineName"
                                            ForeignKeyField="MachineID" DataSourceID="LinqDataSource3"  />
                                    </ResourceTypes>
                                    <ResourceHeaderTemplate>
                                        <asp:Panel id="pnlResourceHeader" runat="server" style="background:green">
                                           <asp:Label ID="lblMachineName" runat="server" Text="Label"></asp:Label>
                                           <br />Containers: <asp:Label id="lblContainers" runat="server" /> of <asp:Label id="lblMaxContainers" runat="server" />
                                        </asp:Panel>
                                    </ResourceHeaderTemplate>
                                    <TimelineView UserSelectable="false" />
                                    <TimeSlotContextMenuSettings EnableDefault="false" />
                                    <AppointmentContextMenuSettings EnableDefault="true" />
                                </telerik:RadScheduler>

Stuart Watton

10 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 21 Oct 2010, 04:57 PM
Hi Stuart,

We are not aware of such issue and we also cannot replicate it with the code  you sent us. Please, open a support ticket and send us a simple working demo which we can test locally.

Thanks.

Peter
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
Keith Lubbers
Top achievements
Rank 1
answered on 24 Nov 2010, 08:54 PM
I am having this same problem. Were you able to find a solution?
0
mahesh
Top achievements
Rank 1
answered on 07 Mar 2011, 01:53 PM
I am facing the same problem.
0
Peter
Telerik team
answered on 10 Mar 2011, 12:36 PM
Hello guys,

We haven't been able to replicate the problem locally. If anyone has a sample of the issue, feel free to send it to us via a support ticket and we will look into it.

Regards,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Sathish
Top achievements
Rank 1
answered on 01 Sep 2011, 09:15 PM
Hi,

I am able to replicated this in the latest builds. Currently I am using 2011.2.712.35. I was able to reproduce this in the latest internal build as well.

Here is the code:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm3.aspx.vb" Inherits="ERP.OM.Web.WebForm3" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="ScriptManagerMain" runat="server" ScriptMode="Release">
            <CompositeScript>
                <Scripts>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                    <asp:ScriptReference Assembly="ERP.Common" Name="ERP.Common.jquery.1.4.1.min.js" />
                </Scripts>
            </CompositeScript>
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadAjaxManagerProxy ID="rampSchedule" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rsMain">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rsMain" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
        <telerik:RadScheduler runat="server" ID="rsMain" DataEndField="EndDate" DataStartField="StartDate"
            OverflowBehavior="Expand" EnableDescriptionField="true" DataSourceID="odsSchedule"
            DataSubjectField="Subject" AllowDelete="false" DataRecurrenceField="RecurrenceRule"
            DataRecurrenceParentKeyField="RecurrenceParentID" DataDescriptionField="Notes"
            DataKeyField="ScheduleID">
        </telerik:RadScheduler>
        <asp:ObjectDataSource runat="server" ID="odsSchedule" TypeName="ERP.CRM.BL.Schedules"
            SelectMethod="GetAllSchedules"></asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>

And the code behind, well it contains the function to update my db. so you may have to replace it with something else.
Public Class WebForm3
    Inherits System.Web.UI.Page
 
 
    Private Sub rsMain_AppointmentCreated(sender As Object, e As Telerik.Web.UI.AppointmentCreatedEventArgs) Handles rsMain.AppointmentCreated
        e.Appointment.AllowDelete = True
    End Sub
 
    Private Sub rsMain_AppointmentDelete(sender As Object, e As Telerik.Web.UI.AppointmentDeleteEventArgs) Handles rsMain.AppointmentDelete
        Schedules.DeleteSchedule(CInt(e.Appointment.ID))
    End Sub
 
    Private Sub rsMain_AppointmentInsert(sender As Object, e As Telerik.Web.UI.AppointmentInsertEventArgs) Handles rsMain.AppointmentInsert
        Dim dict As New Dictionary(Of String, Object)
 
        dict.Add("Subject", e.Appointment.Subject)
        dict.Add("StartDate", e.Appointment.Start)
        dict.Add("EndDate", e.Appointment.End)
        dict.Add("Notes", e.Appointment.Description)
 
 
        Schedules.InsertSchedule(dict)
 
    End Sub
 
    Private Sub rsMain_AppointmentUpdate(sender As Object, e As Telerik.Web.UI.AppointmentUpdateEventArgs) Handles rsMain.AppointmentUpdate
        Dim dict As New Dictionary(Of String, Object)
 
        dict.Add("Subject", e.ModifiedAppointment.Subject)
        dict.Add("StartDate", e.ModifiedAppointment.Start)
        dict.Add("EndDate", e.ModifiedAppointment.End)
        dict.Add("Notes", e.ModifiedAppointment.Description)
 
        Schedules.UpdateSchedule(CInt(e.ModifiedAppointment.ID), dict)
    End Sub
 
 
 
End Class



The errors that I get:
Error: $telerik.$.modal is not a function
Source File: http://localhost:5001/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ScriptManagerMain_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a111e8464-2436-44db-9b34-0d84ed5253c8%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.2.712.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a326e32e2-cd52-462c-ba2c-db5128e4371b%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3a4c8be21a%3af46195d3%3a874f8ea2%3a650fdad%3ad40f7d5c%3ae91ff703%3a7666c7ed%3aa51ee93e%3a59462f1
Line: 5128

I get the error even when I try to move the appoinment.

0
Veronica
Telerik team
answered on 02 Sep 2011, 07:53 AM
Hello Sathish,

I already answered in ticket #460181. I suggest that we continue the conversation in the Support Ticket.

Greetings,
Veronica Milcheva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Markus Hopfenspirger
Top achievements
Rank 2
answered on 28 Feb 2013, 01:50 PM
Hello,

I have the same Problem. What was the solution?

Kind regards,
Markus
0
Sathish
Top achievements
Rank 1
answered on 28 Feb 2013, 03:32 PM
Hi Markus,

The reason why you get this error is because you are using composite script when registering the controls in the RadScriptManager. By some reason this fails the javascript of the RadScheduler. You need to use standard scripts instead of combined ones:
<telerik:RadScriptManager ID="ScriptManagerMain" runat="server" ScriptMode="Release">
           <Scripts>
               <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
               <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
               <asp:ScriptReference Path="~/Scripts/jquery-1.4.1.min.js" />
           </Scripts>
       </telerik:RadScriptManager>

Well, at least that was the issue in mine. Difficult to comment without seeing your code.
0
Markus Hopfenspirger
Top achievements
Rank 2
answered on 28 Feb 2013, 03:48 PM
Hello Sathish,

thanks for the quick answer! It did not solve the Problem for me. Here is my code:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableScriptGlobalization="true">

<Scripts>

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>

</Scripts>

</telerik:RadScriptManager>

<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="Content">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="Content" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManager>

<asp:Panel runat="server" ID="Content"

 

 

/>

and than I create the scheduler in Code behind like this and add it to the Content Panel:

private RadScheduler _scheduler;

public TelerikScheduleBuilder(string id, int width, int height) {

_scheduler = new RadScheduler();

 

 

_scheduler.ID = id;

 

_scheduler.Skin = "Telerik";

 

 

_scheduler.Width = width;

_scheduler.Height = height;

 

_scheduler.SelectedView = SchedulerViewType.WeekView;

_scheduler.SelectedDate = DateTime.Now;

_scheduler.WorkDayStartTime = TimeSpan.FromHours(5);

_scheduler.WorkDayEndTime = TimeSpan.FromHours(18);

_scheduler.FirstDayOfWeek = DayOfWeek.Monday;

//_scheduler.DisplayDeleteConfirmation = false;

//_scheduler.TimeZoneOffset = TimeSpan.FromHours(1);

_scheduler.Culture = CultureInfo.CreateSpecificCulture("de-DE");

_scheduler.StartEditingInAdvancedForm = true;

_scheduler.EnableDescriptionField = true;

_scheduler.OverflowBehavior = OverflowBehavior.Auto;

_scheduler.AppointmentStyleMode = AppointmentStyleMode.Default;

_scheduler.AllowDelete = true;

_scheduler.AdvancedForm.Modal = true;

_scheduler.WebServiceSettings.Path = "SchedulerWebService.asmx";

_scheduler.TimeSlotContextMenuSettings.EnableDefault = true;

_scheduler.AppointmentContextMenuSettings.EnableDefault = true;

 

 

}

 

public TelerikScheduleBuilder AddToContent(Control content) {

 

 

content.Controls.Add(_scheduler);

 

return this;

 

 

}

 

 

 

(Well the same Problem occurs if I create a new Project with the Telerik Scenario Wizards...???)
Nice greetings, Markus

0
Markus Hopfenspirger
Top achievements
Rank 2
answered on 02 Mar 2013, 12:22 PM
Just for others having the same Problem: Telerik Support solved the Problem for me:
The solution is to add the following lines in Web.Config: when using the Telerik Scheduler Control.

<configuration>

<appSettings>

<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>

</appSettings>
......

Kind regards and have fun with telerik,
Markus

Tags
Scheduler
Asked by
Stuart Watton
Top achievements
Rank 2
Answers by
Peter
Telerik team
Keith Lubbers
Top achievements
Rank 1
mahesh
Top achievements
Rank 1
Sathish
Top achievements
Rank 1
Veronica
Telerik team
Markus Hopfenspirger
Top achievements
Rank 2
Share this question
or