I am using DHTMLX Scheduler along with Jquery. I use to create meetings in my application. we have a requirement saying if the meeting time overlaps then a confirm box needs to be displayed.
if the user opts for cancel no changes should be made to the scheduler.
My issue is I am able to stop the changes in DB but not in Scheduler. As soon as we click cancel the updated details appear on the scheduler. But if we reopen the page it modified data does not appear.
Is there way that we can stop the scheduler not to update the details if the data is not saved in the DB.
Seems you just need to call scheduler.deleteEvent()method to remove new event also from the calendar.
Here is an example which can help you to understand how to implement it: https://snippet.dhtmlx.com/5/35f47df72 - try to create new event and then click on “No”.
Please pay attention to callback function in the onBeforeLightbox handler. When the user click on “no”, Else condition deleted an event which already rendered in the Scheduler. I think you need a similar solution for your issue.
If that doesn’t help you to solve the issue, please clarify why and try to update the snippet to reproduce issue from your project. Then I will be able to understand what I missed and how to fix.
Thanks for your reply.
Maybe I should have been more clear in explaining about my implementation.
Fuctionality :- Basically, few validations are done before create or update operation (with save button) in the light box,
and then a confirm box is shown with proceed and discard buttons.
Proceed button operations
a) should save/update the details in DB – WORKING FINE
b) should show the saved/updated Event details on the scheduler(in sync with DB - WORKING FINE
Discard button operations
a)During create or update operation - should not save the details in DB - WORKING FINE
b)Should revert the changes done to the Scheduler PARTIALLY WORKING
i) create operation - the event details which appear on scheduler should be removed - WORKING FINE (I used “scheduler.deleteEvent()” to remove the changes from Scheduler.)
ii) update operation — The data changes should be reverted on the scheduler - NOT WORKING
I am facing issues exactly at discard operation-> b->ii).
I tried running 'scheduler.ClearAll()along with scheduler.load(). But thescheduler.load()` is not working, might be because of cookies this is my guess.
Is there a way to revert the changes on Scheduler during update operation?
Do you mean changes of one event or several events?
Why do you call clearAll()?
There is also updateEvent() method to rerender one updated event, maybe it makes sense to use this method instead of reload all events.
One more demo how to revert changes after dragging the existed event: https://snippet.dhtmlx.com/5/dcaccde9a - operations b and ii are working correctly there.
If it is still doesn’t help you to find a solution, please provide with access to your app, or at least send the code. Probably it will help me to understand your way of implementation and why it doesn’t work as you need.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan