defines a handler function for a specific response status
status | string | the response status |
handler | function | a handler function for processing the specified status of response |
myDataProcessor.defineAction("error",function(response){
alert(response.firstChild.nodeValue);
return true;
});
There are 5 predefined statuses of response:
You can also specify a custom status and set it as a parameter:
// server side: PHP, dhtmlxConnector
function validate($data){
if ($data->get_value("some")=="") $data->set_status("my_status")
}
$conn->event->attach("beforeProcessing","validate");
// client side:
dp.defineAction("my_status",function(response){
//your custom code
return true;
})
The handler function takes 1 parameter: