I need to call some functions after a row is inserted in the database (with dataporcessor). I tried using defineAction(“insert”,myHandler) and myHandler function was called well, but I need to know how I can get the SID, TID and ACTION returned by the server (via XML). Is it possible?
myHandler function can have a parameter “node” wich is the xml node of the action response:
If your responsse is like:
<?xml version="1.0" encoding="ISO-8859-1"?>
<data>
<action type="insert" sid="80" tid="40"/>
</data>
you can use:
function myHandler(node){
type = node.getAttribute("type"); // type will be = 'insert'
sid = node.getAttribute("sid"); // sid will be equal to '80'
tid = node.getAttribute("tid"); // tid will be equal to '40'
//Do something();
return true;
}
You can also include more attributes on tag “action” to send more information to the client.