Background: We are splitting events that span multiple days into multiple appointments. We would like to have them show up as multiple appointments after save.
I am trying to use the dataprocessor “onAfterUpdate” to force the reload. I have noticed that the onAfterUpdate event is only firing if there is an error (action.Type = DataActionTypes.Error;).
Am I missing something in the configuration? Or is this how the event functions?
After a lot of digging and searching I was able to determine why the insert doesn’t fire the onAfterUpdate event that was attached. This is the code that is auto-gen from the scheduler. node.attributes is undefined so it throws an exception and causes execution to stop. Does anyone know why it is undefined? Or what is should contain?
scheduler.dataProcessor.attachEvent('onAfterUpdate', function (s_id, action, t_id, node) {
if(action == 'inserted' || action == 'updated'){
var ev = scheduler.getEvent(t_id);
for(var i = 0; i < node.attributes.length; i++){
var attr_name = node.attributes[i].name;
if(attr_name.indexOf('dhx_') != 0)
continue;
var property_name = attr_name.replace('dhx_', '');
if(ev[property_name] instanceof Date || property_name == 'start_date' || property_name == 'end_date'){
ev[property_name] = scheduler.templates.xml_date(node.attributes[i].value);
}else{
ev[property_name] = node.attributes[i].value;
}
}
scheduler.updateEvent(t_id);
}
});
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan