Hi
I’m trying to detect concurrency issues where two people update one record. I’m doing this with a timestamp in the database. What I want to do is send back the new timestamp value in the returned XML like this
and then have access to the xml in the “onEventChanged” event.
is this possible?
Regards
Jeremy
Hello,
If you use connectors, it is possible set afterUpdate event handler:
function doAfterProcessing($action){
$action->set_response_attribute("ts","12345");
}
$gridConn->event->attach("afterProcessing",doAfterProcessing);
The details can be found here:
[dhtmlx.com/dhxdocs/doku.php? ... _responses](http://www.dhtmlx.com/dhxdocs/doku.php?id=dhtmlxdataprocessor:custom_server_side_responses)
Hi
I’m using perl at the server end.
This works but does need some global data
Jeremy
var lastxml
scheduler.locale.labels.workweek_tab = “W-Week”
//load stuff
scheduler.config.xml_date="%Y-%m-%dT%H:%i";
scheduler.init(‘scheduler_here’,null,“week”);
scheduler.setLoadMode(“month”);
//scheduler.load(“events.xml”);
scheduler.load(“ajax/entries.cgi”);
myDataProcessor = new dataProcessor(“ajax/test.cgi”); //lock feed url
//myDataProcessor.enableDebug(true);
myDataProcessor.init(scheduler); //link dataprocessor to the scheduler
myDataProcessor.defineAction(“updated”,function(tag){
//will need this later in after update…
lastxml = tag
return true;
});
…
scheduler.attachEvent(“onEventChanged”, function(event_id,event_object){
alert(“changed”);
event_object.ts = lastxml.getAttribute(“ts”);
//alert (event_object.ts)
})
You can set a new property of updated event directly in the update handler:
dp.defineAction(“update”,function(node){
var id = node.getAttribute(“sid”);
var event = scheduler.getEvent(id);
event.ts = node.getAttribute(“ts”);
return true;
})
Hi
very good. thats much clearer
Thanks
Jeremy