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
515
WebScheduleInfo loses track of active day on a WebDayView when scrolling to the next/previous week and clicking an all day event.
posted

We have a Monthy View for time entry, using WebMonthView. I created a Weekly view of that same data using a WebDayView spaned 7 days and putting the time in as AllDayEvents. The first week displayed works great, click any day displayed,    WebScheduleInfo2.ClientEvents.ActivityDialogOpening fires, "WebSchedualeInfo1_ActivityDialogOpening" the date is correct everything is roses.

 function WebSchedualeInfo1_ActivityDialogOpening(oScheduleInfo, oEvent, oDialog, oActivity) {

            oEvent.cancel = true; //Cancel default form

            var id = oActivity.getDataKey();

            if (id != null && id > 0) {
                window.open('ExceptionTimeEntry.aspx?id=' + id, 'EditingExceptionTimeEntry', 'menubar=no,resizable=1,width=1300,height=450,toolbar=no,scrollbar=no,location=no');
            }

            else {
                var StartTime = oActivity.getStartDateTime(); //Get Activity start time to pass to custom form
                var tm = StartTime.toDateString(); //Set as datestring
                window.open('ExceptionTimeEntry.aspx?sd=' + tm, 'NewExceptionTimeEntry', 'menubar=no,resizable=1,width=1300,height=450,toolbar=no,scrollbar=no,location=no');

            }

        }

The issue is if you move off the first rendered week using the arrows on the control the oActivity.getStartDateTime() is the start of the week when you click in the alldayevent section of the control. Say you have it showing the 1st to the 7th, you click next week, it shows 8th to the 14th, you click the 11th, the date loads with the 8th, not the 11th. Looking at the other objects passed i don't see anything that is getting the correct active date.