Hi,
I'm creating a page on DNN with 2 separate custom modules. The 1 module holds the WebCalendarView and the 2nd module contains controls for the WebMonthView, WebDayView, WebWeekView. Each module has their own WebScheduleInfo object.
I've enabled the ClientEvent for the Webschedule info object on module2 (containing the WebMonthView) to handle the ActiveDayChanged event when the user clicks on a new date so that the WebCalendarView in Module 1 will have it's active day automatically updated. Now the problem lies in that when I select a date from the WebMonthView in module2, the WebCalendarView active date in module1 is only being updated 1 step behind i.e. it will only set the date in the WebCalendarView after I selected the 2nd date in the WebMonthView. Obviously this isn't ideal as the dates need to be synchronised.
And before you ask why don't I just add the WebCalendarView into the same module as the WebMonthView........ I would love this to be the case but unfortunately the requirements for the project dictates that they be in separate modules.
Is there a line or method which will refresh the WebScheduleInfo object in the 1st Module(CalendarView) which will synchronise the dates?
Here's the code:
//this is the code for the WebCalendarView module
<igsch:WebScheduleInfo ID="mm_WebScheduleInfo" runat="server"> <ClientEvents ActiveDayChanged = "MultiviewDateChanged" /></igsch:WebScheduleInfo>
<igsch:WebCalendarView ID="WebCalendarView1" runat="server" > <ClientEvents Click="WebCalendarView1_Click" DblClick="WebCalendarView1_DblClick" /></igsch:WebCalendarView>
//this is the code for the WebMonthView module
<igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server" WeekRule="FirstDay" StyleSetName="" StyleSetPath="" StyleSheetDirectory="" > <ClientEvents ActivityDialogOpening="OpenCalendarEvent" ActiveDayChanged="GetWebScheduleInfoReference"/> </igsch:WebScheduleInfo>
//The BLOCKED SCRIPT
//gets the web schedule info object.function GetWebScheduleInfoReference(){ debugger;
//get the schedule info in module 2 var scheduleInfo = ig_getWebScheduleInfoById("dnn_ctr370_Schedule_WebScheduleInfo1");
//get the schedule info in module1 var mm_ScheduleInfo = ig_getWebScheduleInfoById("dnn_ctr372_MultiMonthCalendar_mm_WebScheduleInfo");
//set the activeDay of WebScheduleInfo info in module 1 to equal that of Module2 mm_ScheduleInfo.setActiveDay(scheduleInfo.getActiveDay()); }
Hello,
Try the following:
function GetWebScheduleInfoReference(wsi, evnt, newDate){ //get the schedule info in module1 var mm_ScheduleInfo = ig_getWebScheduleInfoById("dnn_ctr372_MultiMonthCalendar_mm_WebScheduleInfo"); //set the activeDay of WebScheduleInfo info in module 1 to equal that of Module2 mm_ScheduleInfo.setActiveDay(newDate); } http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/WebScheduleInfo_Client_Side_Events_CSOM.html
Hope this helps,
-SteveZ
Nice one Steve! Works like a charm.
Thanks for the help. I was ready to slap my manager for making me do this in 2 separate modules! :P
I forgot that the client side event's passes parameters through.
Cheers
Dan