I need to be able to handle network disconnection and situations where the client is offline. I tried using the onValidationError and onRowMark however the first event is never triggered and the second one is always called twice. We see the last parameter for onRowMark of type object, however we do not have any documentation for it. I have attached the code fragment below. Please advise as to how best to go about doing this.
Thanks for your help,
simsim
// setup CRUD data processor
myDP = new dataProcessor("/myApp/scheduler/eventsx.do");
myDP.setTransactionMode("POST", true);
myDP.live_updates("http://"+ location.hostname +":8008/sync");
myDP.attachEvent("onValidationError", function(id, details){
//custom code here
alert("onValidationError");
});
myDP.attachEvent("onRowMark", function(id, state, mode, invalid){
//custom code here
alert("onRowMark: " + id + ", " + state + ", " + mode + ", " + invalid);
return true;
});
myDP.defineAction("error", function(response) {
alert("Network connection error: \r\n"+
"Message [E100]: " +
response.textContent);
return false;
});
myDP.defineAction("invalid", function(response) {
alert("Network connection error: \r\n"+
"Message [E200]: " +
response.textContent);
return false;
});