Call custom script after Sendata() is finished?

I use dhtmlx tree with dataprocessor for coldfusion.
I have build a context menu in which i can add items to the tree
When a user adds an item, i start the EditItem() function, so the user can choose the text for the tree item.
When the user clicks ENTER on the keyboard, the tree item is sent to the dataprocessor using the sendData() function.

I want to call a function right after the sendData() function has finished saving the tree item to the database. How can i achieve this?

dp.attachEvent("onAfterUpdate", function(){ //will be called after data saving ... some code here ... });