iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi Team -
We were trying to get the Date,StartTime and EndTime of the selected columns on the launch of "New Event". We tried to achieve it via same client side event we used to launch the "New Event" or "Edit Event" but somehow it didn't work for us. Below is the code snippet for the same.
function WebSchedulerSummary_OnEditingFormShow(controlId, evt, action, eventView, eventType, newType) { // variable ResourceID of selected event var ResID = evt.ResourceID; // variable startdatetime of selected event var StartDate = evt.StartTime.getDate(); // variable new StartDateTime of selected event var StartTime = evt.StartTime; // variable new EndDateTime of selected event var EndTime = evt.EndTime;
Somehow the "evt" variable always come out to be "null" or "undefined". Not sure what we are doing wrong here. Also if possible , can you provide me some documentation on webscheduler client side events?
The insight to the above problem will be of great help.
Thanks - Frank
Based on the WebScheduler documentation, the OnEditingFormShow client-side event has five parameters:
You should be able to get the Date, StartTime, and EndTime of the selected column via OnEditingFormShow event in eventView argument.
I enclosed a simple sample of WebScheduler which uses OnEditingFormShow event as attachment. Please have the sample evaluated on your end and let us know whether it helps or not.
Hi Yudi -
Thanks for the prompt reply.
Actually yesterday we checked the values in all those 5 parameters and except "controlID" and "newType" all were null. Attach in the reply is the screen shot for the same ('2014-05-30_1259_OnEditingFormShow_Screen1','2014-05-30_1300_OnEditingFormShow_Screen2').
We also tried with your sample code nut unable to trace "WebSchedulerSummary_OnEditingFormShow" function , actually we tried putting "alert" in the function but it seems to be like not working. Attached in the reply is your sample webscheduler code with our modification ('WebScheduler_CustomEditingForm_Modified') since your actual code some how doesn't work in our environment and if you can verify that its not our modification due to which its not working. Also attached is a video ('2014-05-30_1238_OnEditingFormShow')showing how we were testing your code , the video file is a 'swf' file so you can just drag and drop it in any browser to run it. In the video if you see in the end where we have highlighted date of the picked event and also the resource selected in dropdown basically we are interested in getting those values.
Hope to have a quick solution for the same.
I modified the WebScheduler1_OnEditingFormShow JS function by adding alert which shows the start date and end date of the selected column.
function WebScheduler1_OnEditingFormShow(controlId, action, eventView, eventType, newType){ var WebScheduler1 = ISGetObject(controlId); var dlg = WebScheduler1.EditingDialogBox; alert("start date : " + dlg.Scheduler.StartDateSelection + "\n"); alert("end date : " + dlg.Scheduler.EndDateSelection); var path = "./EditingForm_Custom.aspx?action=" + action; if (action == "Edit") path += "&eventID=" + eventView.GetOriginalObject().EventID; dlg.SetContentURL(path); return true; }
Please feel free to let us know whether this help or not.
This new code is working but we still have few queries regarding it. Below are the same :
1) Why it add 15 minutes to the startDateTiem for the value of EndDateTime. We were expecting something different. Suppose user pick 5:00 PM on a date and drag the mouse to select 5:45 PM on the same date then the StartDateTIme shall be 'DD-MM-YY 05:00 PM' and EndDateTime shall be 'DD-MM-YY 05:45 PM' but somehow the code ('dlg.Scheduler.EndDateSelection') give 'DD-MM-YY 05:15 PM'.
2) Also if you can let us know how to get the selected ResourceId and ResourceName as well. We can see in 'dlg.Scheduler' there are files specifyinh Resources and ResourceIndex but we are not able to figure out how to get the selected resource from there.
Looking forward for a quick response on the above mentioned points.
Please find the attached video, WebSchedulerOnEditingFormShow.wmv. The video shows that I was unable to reproduce the reported problem in my local end using WebScheduler_CustomEditingForm sample (enclosed in my post on May 30, 2014).
Please modify the sample or send me a running simple sample which replicate the problem so that I can assist you further.
A new event will always have its Resource set to the Resource with index 0. For existing event, you can use WebScheduler1.GetSelectedEvent().OriginalObject.ResourceID to obtain its ResourceID.
In order to get the ResourceName, please use WebScheduler1.GetResourceById(ResourceID).ResourceName.
Hope this helps.
We tried your code but some how it didn't work for us. Below is the code snippet that we have used
function WebSchedulerSummary_OnEditingFormShow(controlId,action, eventView, eventType, newType) { var WebSchedulerSummary = ISGetObject(controlId); var EditingDialogBox = WebSchedulerSummary.EditingDialogBox; var dlg = WebSchedulerSummary.EditingDialogBox; console.log(WebSchedulerSummary.GetSelectedEvent()); alert("start date : " + dlg.Scheduler.StartDateSelection + "\n"); alert("end date : " + dlg.Scheduler.EndDateSelection); var resourceId = WebSchedulerSummary.GetSelectedEvent().OriginalObject.ResourceID; var resourceName = WebSchedulerSummary.GetResourceById(resourceId).ResourceName; alert("resourceID : " + resourceId); alert("resourceName : " + resourceName);
We are getting "null" for GetSelectedEvent(). Attached in the reply is a video showing the values we are geting as per the code snippet and also you can see in the video that we are not getting right value in EndDateTime.
I tried to replicate the “15 minutes addition to EndDateTime” by modifying my sample with following detail.
Unfortunately, my efforts were not successful – everything worked smoothly and the returned start date and end date displays correct value.
On the 2014-06-03_1550.swf video, in 0:03, I saw user selects multiple cells at November 07, 2013 06:00 PM – 07:00 PM. On 0:05, an alert showing correct start date information (selected cells are November 07, 2013 06:00 PM – 07:00 PM). However, on 0:08 – when the alert shows incorrect end date information, the selected cells are suddenly changed to November 07, 2014 01:15 PM – 06:15 PM.
In my opinion, the alert (which shows end time information) has returned correct value. What is not correct in here is the sudden change on the cell selection. For your information, this specific problem doesn’t happen on my local end.
...We are getting "null" for GetSelectedEvent()...
Please use GetSelectedEvent() method for existing event only. For new event (event that doesn’t exist yet), by default will have its Resource set to the Resource with index 0. This should explain why you are getting “null” for GetSelectedEvent() method.
Thanks for making effort in trying and reproduce the problem.
Like you mentioned "when the alert shows incorrect end date information, the selected cells are suddenly changed " , I think this might not be a reason for getting a wrong EndDateTime because we tried selecting just one cell on the control board and also in between the alerts there was no sudden change of selected cell position but still we get a EndDateTime as +15 min to the StartDateTime. Attached is a video depicting the same ('2014-06-04_1350.swf').
...I think this might not be a reason for getting a wrong EndDateTime because we tried selecting just one cell on the control board and also in between the alerts there was no sudden change of selected cell position but still we get a EndDateTime as +15 min to the StartDateTime. Attached is a video depicting the same ('2014-06-04_1350.swf').
Pardon for lack of understanding about the reported problem. I look closely on the video, 2014-06-04_1350.swf, and found no problem with the returned EndDateTime.
In the video, one cell is selected on the control board and in between the alerts there is no sudden change of selected cell position. You still get EndDateTime as +15 min to the StartDateTime.
The EndDateTime shown in the alert message is correct. The fact is:
Using the above configuration means that the current view, Timeline view, will shows information within 1 day in 15 minutes duration of the selected date. Allocate an event by selecting a cell in this view will allocate an event which its EndDateTime is +15 minutes to its StartDateTime.
Should you have different opinion, please feel free to let me know.
...Can you please provide a sample code to how to get ResourceName and ResourceID values for a custom AddForm.
Please kindly check the archived sample project, WebScheduler_CustomEditingForm.zip, which is enclosed as attachment on my post at May 30, 2014. The sample project uses custom editing form where the Resource field is shown using ASP.NET DropDownList control. For more detail about how to get ResourceID value for the custom editing form, please check EditingForm_Custom.aspx.cs code.
Hope this help.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname