I am using JQXTree, A sample Html code
<div id='treeA' style='float: left; margin-left: 0px;'>
<ul>
<li id='home' item-selected='true'>Server</li>
<li item-expanded='true'>Incoming Data
<ul>
<li>FTP Adapter</li>
<li item-expanded='true'>RDBMS
<ul>
<li draggable="true">ftpConnection1</li>
<li id='ftpConnection2'>ftpConnection2</li>
</ul>
</li>
<li>NoSql Adapter</li>
<li>RSS Adapter</li>
<li>MQTT Adapter</li>
<li>ZMQ Adapter</li>
</ul>
</li>
</ul>
</div>
$('#treeA').jqxTree({ allowDrag: true, allowDrop: true, theme: theme});
In Image if I drag ftpConnection1
i need to get the Parent Id that is FTP Adapter
and also its Parent's Id that is Incoming Data
.
I use dragEnd event on the tree
$("#treeA").on('dragEnd', function (item) {
console.log(item);
var droppedToolId = item.args.owner._dragItem.id;
var parentId = item.args.owner._dragItem.parentId;
});
So I get the Parent Id, I need to get the Parent’s Parent Id for the item i drop.
Any suggestions?