We are currently facing an issue, that after using scheduler for some time, few events after modifying it don’t allow to get updated any more and when we try to update it (by modifying info or moving event), it shows event in bold and keeps it in bold. If we delete it, it shows it as strike out, but does not delete it. Rest of the events work normally (i.e. CRUD works on other events that have not resulted in this type of anomaly). We tried to reproduce this using same parameters, sometimes it gets reproduced and sometimes it does not .
For now to make that event to work normally again, we have to do browser refresh to refresh the page and scheduler. After that event that resulted in this anomaly works fine again. However this type of anomaly shows up again after some time.
We have been trying to debug this issue for sometime now, so decided to post this in the forum, so someone can point us to the right direction. People in this forum have been extremely helpful in the past as well
From implementation point of view, we have customized the scheduler to use
nodejs is used for synchronization of scheduler for clients (Don’t know if its because of this)
We mainly use firefox for testing.
Custom before insert and before update java functions
myDP.defineAction(“inserted”, function(node) {
try {
// Set values using this type of call:
// scheduler.getEvent(node.attributes.getNamedItem(“sid”).nodeValue).text
// = node.attributes.getNamedItem(“text”).nodeValue;
// scheduler.updateEvent()…
return true;
}
catch (e) {
console.error('ERROR IN myDP.defineAction(“inserted”): ’ + e
}
return false;
});
myDP.defineAction(“updated”, function(node) {
try {
// Set values using this type of call:
// scheduler.getEvent(node.attributes.getNamedItem(“sid”).nodeValue).text
// = node.attributes.getNamedItem(“text”).nodeValue;
// scheduler.updateEvent()…
return true;
}
catch (e) {
console.error('ERROR IN myDP.defineAction(“updated”): ’ + e
}
return false;
});
Hi,
make sure the server-response after update/insert/delete request is sent in correct format and has Content-Type:text/xml or application/xml docs.dhtmlx.com/doku.php?id=dhtm … e#response
The described issue may happen when client-side fails to process the dataprocessor response
The above response looks valid
In case of FF and Chrome it may be important that <?xml version='1.0' encoding='utf-8' ?> is placed as first line of output. If you have newline or some white spaces before <?xml tag, client side can have problems with xml parsing.
Also, the problem can occurs if you have some js error in methods assigned through defineAction, but they look too simple to have any errors
Are you using the latest scheduler or some 2.x version ?
We discovered that during re-load of the scheduler the data processor has a list of invalid and in progress events. We noticed that the in progress list had events with a ‘wait’ status. The invalid list had events with databases ID and also others that had the time value in milliseconds. If any of these events are modified after the data re-load, the data processor fails to save them and shows the text in bold.
We have found a couple of posts on the forum with similar issues and it was suggested that they needed to clear the data processor’s in progress list and call the sendData method using the code below:
// based on viewtopic.php?f=6&t=33219&start=0
dp._in_progress = {};
dp.sendData();
Another post suggested clearing the data processor updated rows list and invalid list
// based on viewtopic.php?f=2&t=13478
dp.updatedRows = [];
dp._invalid = {};
Does dataprocessor._invalid list has any affect on whether an event gets saved or not? Is dataprocessor._in_progress used to save events or style them in bold font? Is it safe to call all four lines in succession after reloading the data? or do we need a special handler to call sendData asynchronously? Please advise.
dataprocessor._invalid
Yes. Invalid items will not be saved automatically. Any edit of such item will clear invalid flag though. So if you have item in invalid list, it will be saved after any UPDATE operation ( edit, drag, etc. )
dataprocessor._in_progress
Items in this list will not be saved. Normally this list must be empty. If you have some records here it means that
you are reloading the scheduler while it in data saving process ( data sent to server but response not retrieved yet )
server side code sends invalid response, and client side doesn’t detect that item was saved
It seems that the issue is related to how the data processor is re-initialized upon reloading of the scheduler. My application has a refresh button which allows the user to re-load the datebook. The code looks like this:
//…
// on application start-up. This is done only once:
dp = new dataProcessor("/myapp/scheduler/eventsx.do");
//…
// on refresh button press
//…
dp._in_progress = {};
dp.sendData();
Is this a valid and safe way to refresh the scheduler? Do we need to invoke anything else on the data processor object before or after clearing the scheduler? Can the dp.sendData() be done in asynchronous mode or do we need to wait for it to complete before we invoke scheduler.clearAll()?
It is still a hack, but must not cause any side effects.
Fully legal solution would be to use onFullSync event of dataprocessor and reload scheduler after it. ( onFullSync occurs after data sending call, response from server side received, so all data is saved and you can safely reload without resetting any inner collections of dataprocessor )
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan