Timeout for DHTMLXScheduler and DHTMLXTree

Hello,

I have a page with a tree on the left of possible events to schedule into a calendar (DHTMLXScheduler) which is achieved with drag n drop.

I was wondering if there was a timeout with Scheduler or Tree? For example, if the user logs in and adds/changes/deletes events and saves. Then does not log out but comes back to the page and drags n drops more events and tries to save. Should this work without a refresh of the page or a new log in?

I am asking because we have been experiencing some strange behavior with some users adding events and then when the “save” script runs we end up losing events which made me think perhaps the Scheduler has a timeout and if the person does not log in again (or I force a log out) then the schedule that gets sent to the script is corrupt, empty or invalid.

Many thanks for your help. I hope I have explained myself clearly…

Cheers,

There is no timeout, so all must work correctly without necessity to re-login.
Issue can be caused by data caching.

If you are loading data in the scheduler like

scheduler.load("some.php")

try to change it as

scheduler.load("some.php?uid="+(new Date()).valueOf())

Hello,

Yes, I am doing what you suggested.

Can you please let me know if you think this should be working fine:

var mydata = encodeURIComponent(scheduler.toXML()); dhtmlxAjax.post(myurl, "data="+encodeURIComponent(scheduler.toXML()), function(loader){...

In the url I am sending the data to, there is a SQL stmt to delete any events that are no longer on the calendar…however, occasionally it wipes out all of the events. So, I believe that the XML must be empty or contain no events, which made me think that perhaps there is a timeout or limit for the cache. Thinking if a user leaves the page and comes back a day later, perhaps what they see on the screen (scheduler) is actually no longer in the cache?

I am having trouble trying to fix this so any help would be much appreciated.

Thanks!

Another idea for my problem—

Is it possible to trigger an update to my database after adding an event (lightbox or copy/paste) and after the “Event will be deleted permanently. Are you sure?” That is to get the event information to send to a php script after each of these events? I am having issues with sending the entire schedule to the script where somehow occasionally an empty XML must be getting sent and my delete statement (built to NOT delete any events in the XML) in the end deletes everything in the date range.

I hope I have explained myself clearly. Many thanks for your help.

Cheers,

Actually, what I need in the case of the delete is the event details from the lightbox which I can then pass to the script to delete from the database as it gets deleted from the scheduler on the screen…

Is this possible and if so can you please tell me how I get the event details during the delete process in the lightbox (and in the other views where you do not have the lightbox).

Many thanks,

Is this possible and if so can you please tell me how I get the event details during the delete process in the lightbox (and in the other views where you do not have the lightbox).

scheduler.attachEvent("onBeforeEventDelete", function(id){ var data = scheduler.getEvent(id); //custom ajax call here return true; })

OK, so I actually will be deleting in my database right before the event is deleted in Scheduler…

??

Yes, but you can be sure that event will be deleted for sure, after that event there is no logic which can stop deleting on the client side.