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
30
Updating WebScheduleInfo.ActiveDay on the clientside (Javascript)
posted

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>
 


<igsch:WebMonthView ID="WebMonthView1" runat="server" AppointmentFormatString="<SUBJECT> (<LOCATION>)" Height="500px"  StyleSetName="" StyleSetPath="" StyleSheetDirectory="" Width="500px"  >
    <ClientEvents DblClick="DoubleClick" />
</igsch:WebMonthView>

 

 

//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());
    
}