Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
32
WebMonthView Appointment Recurrence JS Error Problem
posted

Hello,

I got a webmonthview with 2 appointments, with 1 that is recurrent. When I click on the recurrent appointment, I got a javascript error:

Microsoft JScript runtime error: 'getActivities().getItemFromKey(...)' is null or not an object

Here's the JS code :

if(srcheader == this._selectedHeader.elem)

{

this._selectAppt(src);

if(this._selectedAppt != null)

{

var appResKey = null;

(this._selectedAppt != null) ? appResKey = scheduleInfo.getActivities().getItemFromKey(this._selectedAppt.key).getResourceKey() : ""; ß return null

if (this._selectedAppt != null && appResKey.length > 0 && appResKey != scheduleInfo.getActiveResourceDataKey())

{

scheduleInfo.setActiveResource(appResKey);

ig_cancelEvent(evt);

return;

}                             

}                                

}

When I look the content of "scheduleInfo.getActivities();", the recurrent event is not in the activity list and I don't know why :/

Here my ASP.NET code :

<igsch:WebMonthView ID="WebMonthView1" runat="server" Width="700px" Height="560px" WeekendDisplayFormat="Full" WebScheduleInfoID="WebScheduleInfo1" EnableMultiResourceCaption="True" StyleSheetFileName="/ig_common/20103CLR35/styles/XpBlue/ig_webmonthview.css"            MultiDayEventFromArrowCaption="" MultiDayEventToArrowCaption="" StyleSetName="Office2010Blue" StyleSetPath="" StyleSheetDirectory="" NavigationAnimation="Linear" style="top: 0px; left: 0px" WeekNumbersVisible="False">

<OtherMonthDayStyle Height="30px" />

<ClientEvents DblClick="WebMonthView1_DblClick" Click="WebMonthView1_DblClick" />

<ClientEvents DblClick="WebMonthView1_DblClick"                                   Click="WebMonthView1_DblClick" />

<ActiveDayStyle Height="30px">

</ActiveDayStyle>

<DayStyle Height="30px" />

</igsch:WebMonthView>

<igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server" EnableRecurringActivities="True" EnableReminders="False" EnableUnassignedResource="True" StyleSetName="" StyleSetPath="" StyleSheetDirectory="" EnableMultiDayEventArrows="False" EnableMultiResourceCaption="False"></igsch:WebScheduleInfo>

Here my C# code where I create the 2 appointments :

Infragistics.WebUI.WebSchedule.Appointment toto = new Infragistics.WebUI.WebSchedule.Appointment(WebScheduleInfo1);

Infragistics.WebUI.WebSchedule.Appointment titi = new Infragistics.WebUI.WebSchedule.Appointment(WebScheduleInfo1);

toto.Key = "test";

toto.Subject = "test";

toto.StartDateTime = Infragistics.WebUI.Shared.SmartDate.ParseExact("10/05/2011", "dd/MM/yyyy", null);

toto.EndDateTime = Infragistics.WebUI.Shared.SmartDate.ParseExact("20/05/2011", "dd/MM/yyyy", null);

toto.EnableReminder = false;

toto.Style.BackColor = System.Drawing.Color.Red;

titi.Key = "test42";

titi.Subject = "test24";

titi.StartDateTime = Infragistics.WebUI.Shared.SmartDate.ParseExact("25/05/2011", "dd/MM/yyyy", null);

titi.EndDateTime = Infragistics.WebUI.Shared.SmartDate.ParseExact("25/05/2011", "dd/MM/yyyy", null);

titi.EnableReminder = false;

titi.AllDayEvent = true;

titi.CreateRecurrence();

titi.Recurrence.Key = "rec_" + titi.Key;

titi.Recurrence.Period = Infragistics.WebUI.WebSchedule.RecurrencePeriod.Yearly;

titi.Recurrence.DayOfMonth = 25;

titi.Recurrence.MonthOfYear = 5;

titi.Recurrence.MaxOccurrences = 2;

titi.RecurrenceKey = "rec_" + titi.Key;

titi.Recurrence.PeriodMultiple = 0;

titi.Style.BackColor = System.Drawing.Color.Green;

WebScheduleInfo1.Activities.Add(toto);

WebScheduleInfo1.Activities.Add(titi);

 

Thanks in advance.