Hi,
I am using the client side double click event to show a custom appointment form.
How do i get the date-time on which user clicked in the month view, week view(dayview with visible days set to 7) and day view.
For month view (and old week view) i used the code snippet mentioned in this post http://blogs.infragistics.com/forums/t/41180.aspx, but this works only when user clicks on the header.
I am using the latest infragistics release (2011 volume 2)
Hello appoint,
I suggest using the ActiveDayUTC property of WebScheduleInfo. ActiveDayUTC represents the current and day.
For more information regarding this property, you may refer to the following documents:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/Infragistics4.WebUI.WebSchedule.v11.2~Infragistics.WebUI.WebSchedule.WebScheduleInfo~ActiveDayUtc.html
If you have any questions, please let me know as well.
Hi Vivian,
How do i get the ActiveDay value in the client side event (Javascript).
Also will ActiveDay return the correct date on which the user double clicked in case of month view and weekview (day view with visible days set to 7).
Hello apppoint,
Thank you for the update.
Please let me know as to which event did you access ActiveDay() ?
I have registered for a client side event on the schedulerview using -
webDayView.ClientEvents.DblClick = "scheduler_dblClick";
the client side javascript function looks something like this -
Since ActiveDay is part of the WebScheduleInfo object, you may use WebScheduleInfo's ActiveDayChanged or ActiveDayChanging event. These events are triggered when a date is clicked. By default ActiveDay is set to the present day. These two events have the a parameter called newDate. This newDate parameter contains the new ActiveDay. You may then set ActiveDay to newDate by using setActiveDay().
For more information please refer to the following documentation:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/WebScheduleInfo_Client_Side_Events_CSOM.html
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=WebSchedule_ActiveDay_Events.html
Please let me know if you have any questions.
Will it be possible for you to share a working sample of the same? i think it will help us resolve this issue faster
Please let me know what version of NetAdvantage you are using.
Hello Venki,
There are a couple of ways to capture the time associated with a doubleclick. One is by using the HTML element of the WebDayView as each timeslot is a <td> with a unique "uie" referred to as "SLOT". You may access the timeslot through the elem argument's getAttribute("uie") in the DBLClick event. A "SLOT" corresponds to a timeslot defined by the time interval. For example if SLOT18 is 10:00 timeslot, SLOT19 is 10:30 timeslot with a 30-minute interval. If we take the slot # and multiply it by the time interval we will get the timeslot. With this approach you may use the following code:
function schedulerDblClick(oSchedulerView, evt, elem) { debugger; evt.cancel = true; var uie = elem ? elem.getAttribute('uie') : null; var oScheduleInfo = ig_getWebScheduleInfoById('<%= WebScheduleInfo1.ClientID %>'); if (!uie || !(uie.indexOf('SLOT') != 0 || uie.indexOf('LABL') != 0)) return; var i = parseInt(uie.substring(4)); //alert('time:' + i * oDayView.getTimeSlotInterval() + ' minutes'); var time = i * oSchedulerView.getTimeSlotInterval(); var activeDay = oScheduleInfo.getActiveDay(); alert(time); }
For more details, please refer to the following forum thread:
http://blogs.infragistics.com/forums/t/35680.aspx
You may also use the WebScheduleInfo's ActivityDialogOpening clientside event. This event is triggered by a doubleclick. You may also set the ActiveDay to the date and time returned by getStartDateTime().
function WebScheduleInfo1_ActivityDialogOpening(oScheduleInfo, oEvent, oDialog, oActivity) { //Add code to handle your event here. debugger; oEvent.cancel = true; var start = oActivity.getStartDateTime(); var key = oActivity.getDataKey(); alert(start); // window.showModalDialog("Default2.aspx?StartTime=" + start); }
I hope this helps. Sincerely,VivianDeveloper Support EngineerInfragisticswww.infragistics.com/support
All i need to do is capture the datetime slot on which the user double clicked in the client event on the scheduler irrespective of whether i am using a WebMonthView or a WebDayView.
I am uploading a sample of the same.
When i double click anywhere on the WebMonthView ScheduleInfo.getActiveDay(); returns the selected date as expected.
But In case of a WebDayView the value returned does not have the correct time info (For Ex - Wed Feb 15 00:00:00 UTC+0530 2012 - no matter on what time-slot i double click it always show time as 00:00:00 ) and when the number of visible days is greater than 1 it always returns first day as activeday.
Hope this explains my requirement. Please let me know if you need any further clarifications
With the WebDayView, the ActiveDay is rendered as the first day of the collection of days. I have attached a sample using WebDayView.
Please let me know if this is the behavior you are seeing, or otherwise.
I may need more details on the time element you metioned.
WebScheduleInfo.getActiveDay() works fine in case of a webMonthView, in case of a webDayView the time part of the users selection is not captured by this api. Also if the number of visible days > 1 the api returns incorrect results.