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
Gentlemen,
Can you please advise how to prevent timeline time overlaps when MOVING or RESIZING color bars? I am not sure where or how to implement this, I am assuming it is a client side event?
Here is my scenario based on the attached document image:
For example: If resource "1" has an existing appointment "A" scheduled from 1pm to 330pm, I cannot allow a user to move or resize ANOTHER existing appointment "B" that has a startdatetime or an enddatetime that "overlaps" the existing appointment "A" in Resource 1.
In other words, if existing Resource "1" appointment "A" is from 1:00pm to 330pm, I cannot allow another existing appointment "B" to be MOVED or RESIZED into existing appointment "A" where appointment "B" startdatetime or enddatetime falls between 1:01pm to 3:29pm. I need a warning to the user that this is not allowed and stop the appointment "B" color bar from being moved or resized.
Please see the attached document. Resource Eco 2 - Mav and Resource Eco 3 - Mav both have 2 appointments that start and end at the same time, this is ok. However, Resource Eco 1 - Mav has one appointment from 100pm to 330pm and another appointment from 130pm to 400pm, this is not ok as one appointment "overlaps" the other.
I am able to control the user not being able to ADD an overlapped appointment through my custom editing form, I just do not know how to stop the user from moving or resizing an existing appointment into another existing appointment.
You help would be greatly appreciated!
Frank
Hello,
Thank you for patiently waiting.I made a sample that maybe can resolve your problem. In my sample, I use WebScheduler_Personal.mdb database.Then I do a validation in OnBeforeEdit() client side event. And I use “WebScheduler1.EventViews” to get all event data in that day and the next day.Here’s the snippet script below:
function WebScheduler1_OnBeforeEdit(controlId, evt) { var WebScheduler1 = ISGetObject(controlId); // variable ResourceID of selected event var ResID = evt.ResourceID; // variable EventID of selected event var EventID = evt.EventID; // variable date of selected event var Date = evt.StartTime.getDate(); // variable new StartTime of selected event var NewStartTime = evt.StartTime; // variable new EndTime of selected event var NewEndTime = evt.EndTime; var EditMode = 0; for (var i = 0; i < WebScheduler1.EventViews.length; i++) { // variable another event date var OtherDate = WebScheduler1.EventViews[i].StartTime.getDate(); // if the other event have same date with the selected event if (Date == OtherDate) { // if the another event is Recurring Event if (WebScheduler1.EventViews[i].OriginalObject.EventID == -1) { var OtherEventID = WebScheduler1.EventViews[i].OriginalRecurringObject.EventID; var OtherResID = WebScheduler1.EventViews[i].OriginalRecurringObject.ResourceID var OtherStartTime = WebScheduler1.EventViews[i].OriginalRecurringObject.StartTime; var OtherEndTime = WebScheduler1.EventViews[i].OriginalRecurringObject.EndTime; } // if the another event is not Recurring Event else { var OtherEventID = WebScheduler1.EventViews[i].OriginalObject.EventID; var OtherResID = WebScheduler1.EventViews[i].OriginalObject.ResourceID var OtherStartTime = WebScheduler1.EventViews[i].OriginalObject.StartTime; var OtherEndTime = WebScheduler1.EventViews[i].OriginalObject.EndTime; } // if don't have same EventID if (OtherEventID != EventID) { // if have same ResourceID if (OtherResID == ResID) { // if the event is overlapping with another event if (NewStartTime.getTime() > OtherStartTime.getTime() && NewStartTime.getTime() < OtherEndTime.getTime()) { EditMode++; } // if the event is overlapping with another event else if (NewStartTime.getTime() == OtherStartTime.getTime()) { EditMode++; } // if the event is overlapping with another event else if (NewStartTime.getTime() < OtherStartTime.getTime() && NewEndTime.getTime() > OtherStartTime.getTime()) { EditMode++; } } } } } // if doesn't overlapping with another event if (EditMode < 1) { return true; } // if overlapping with another event else { alert("This event overlapping with another event.!"); return false; } }
I also attached my sample, in order to make you more easily understand about my sample.Hope this helps. Thank you.
Regards,Hans
I’m sorry for late response.
Unfortunately we still can’t validate overlapping timeline time when moving or resizing color bars.
Now we are discussing how to resolve this problem with developer division.
I’m sorry for the inconvenience. I’ll let you know if we can validate overlapping timeline time.
Thank you for understanding.
Regards,
Hans.
Hi Hans,
Thank you for the reply. Let me simplify my requirement.
Is it possible to prevent "default" timeline view color bar moving or resizing without first performing a database record validation?
In other words, is it possible through a client side event to perform any kind of database record validation prior to moving or resizing a color bar? For example:
function X - (client side event)
if myvalidation = true
>>>allow move/resize
if myvalidation = false
>>>show error message and do not allow move or resize
Please advise and best regards,
Frank Gary
Hans,
Thanks so much for providing this information, it is GREATLY appreciated!!!
We will try the solution next week and post back the results.
Thanks again!
You're welcome.Should you have further question, please do not hesitate to ask us again. I would be happy to help you again.
Regards,Hans.
Thank you very very much. Your solution worked perfect!
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