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
142
How to get the day and time detected from time slot on the WebDayView where the user double-clicked in to open the Add/Edit Appointment form?
posted

In a custom schedule how to get the day and time detected from time slot on the WebDayView where the user double-clicked in, and then open Add/Edit Appointment form and pre-populate the date & time values.

This is what my customized scheduling in short:  I use my own database schema (SQL Server 2005 database) and I created a custom data provider (and stored procedures for all data CRUD operations) by implementing the IDataFetch and IDataUpdate interfaces, the custom data provider inherits from the WebScheduleDataProviderBase class. I also created a CustomAppointment class that inherits from Appointment and added my custom members and properties. I am using a Master Page in the aspx page that holds all my WebSchedule controls. I am creating tabs (I'm using UltraWebTab) and views (currently WebDayView, later Week and Month views as well) and schedules (WebScheduleInfo) in my VB code.  I don't hardcode them in the aspx file because I call the database (via FetchResources) and for each resource add a tab with a view and a schedule. I have myWebDayView.EnableAutoActivityDialog = True.

I think for the built-in schema this JS script does the job: ig_webdayview.js.

Thanks,

 Alex

  • 142
    posted

    The answer is as simple as this:

    what you would ideally want to do would be to fetch the StartDateTime on the ActivityDialogOpening client side event on the WebScheduleInfo and then use the StartDateTime and append it as a querystring to your own custom AppointmentDeatils.aspx page. Here is the JavaScript code for the function WebScheduleInfo1_ActivityDialogOpening. >>function WebScheduleInfo1_ActivityDialogOpening(oScheduleInfo, oEvent, oDialog, oActivity){>>           oEvent.cancel = true;          //Cancel default form                                          >>           var StartTime = oActivity.getStartDateTime()        //Get Activity start time to pass to custom form               >>           window.showModalDialog("CustomForm.aspx?StartTime=" + StartTime); //Open custom form and pass starttime as query string }