I receive old data when I use javascript with zTree - drag and drop

I receive old data when I use javascript with zTree - drag and drop

  
Guys, now the problem is on drag and drop. When I move a node to a new folder it doesn´t show the parent. But when I click on the node the parent appears. I tried to select the node again but without success. I was thinking to click on node using Javascript but I don´t know how to do it. I attached the oml file and the screen showing the problem. I will appreciate any help.  Thanks 

Below I am attaching the lastest Test version.  I solved some mistakes. It seems when I have a new node, the drag and drop function (function ondrop available on preparation) doesn´t handle the parent. Or I am accessing the wrong variable to get the parent id.  Weird this problem always occurs when a node is created dinamicaly
Someone can help me ?
Guys, I am attaching the solution to the problem I requested help.  Maybe it can help someone that would like to use zTree supplying keys to update the hierarchy into database    ?