Hello Webix Support,
Could you please provide assistance regarding event handlers for add/update/delete operations in the Mobile Scheduler?
Our use-case is the following: when users add/update/delete appointments in the Mobile Scheduler our code sends asynchronous Ajax calls to our PHP/HTTP server to handle those operations.
Currently our Ajax calls are sent from within onAfterAdd/onStoreUpdated/onAfterDelete event handlers that we’ve added to our scheduler.
However, at times our PHP/HTTP server fails to perform the requested Ajax action and returns a 5XX HTTP error.
Unfortunately the default event handlers coded into the Mobile Scheduler process the add/update/delete operations before our server responds.
As a result in the scheduler UI an event is being created/updated/deleted despite the data model not being modified on the server side.
Please note that our data model is somewhat complex, so I don’t think we can use the PHP Data Connector directly (assuming that this would potentially solve our problems). We’re also using custom event templates, with additional fields compared to the default Mobile Scheduler set-up.
I’ve tried attaching “onItemClick” event handlers to the “save” and “delete” buttons on top of the default event handlers instead of attaching onAfterAdd/onStoreUpdated/onAfterDelete handlers. This doesn’t solve our problem though – it seems impossible to force our “onItemClick” event handlers to be executed before the default ones.
I’ve also tried detaching the default event handlers from “save” and “delete” buttons using the “detachEvent” handler method, but was unable to – looking at the mobile scheduler source code the default handlers do not seem to have an ID defined which we could use to detach them.
Could you please advise how best to address our use-case?
Best regards,
Jakub Kornas