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 apppoint,
Please let me know if you have any questions.
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
Hi Vivian,
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
Hello appoint,
Thank you for the update.
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.
If you have any questions, please let me know as well.
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.