Hi,
I’m using jqxTree , I want to set the tree max depth to 1. so that I can drag the leaves.
the product functionality is : users can change the priority.
so I want to use jqxTree to reach it.
the product is using jqx widgets. so can’t change to other js trees.
so any one could help me ?
I wrote a examle,but there is bugs .
$(“#priorityTree”).on(‘dragEnd’, function (event) {
var items = $(‘#priorityTree’).jqxTree(‘getItems’);
for(var i=0;i<items.length;i++) {
if(items[i].parentElement != null) {
var itemBak = items[i];//item to be removed
var parentItem = $(‘#priorityTree’).find(“#” + items[i].parentId)[0];
$(‘#priorityTree’).jqxTree(‘removeItem’, items[i]);
$(‘#priorityTree’).jqxTree(‘addAfter’, {label : itemBak.label}, parentItem);
}
}
});
at first there are 4 leaves.when I drag one on to another,they become father and child,I don’t want father and child,only want they all at one level. so when drag one on to another,I remove the child and then and the child after father.
the bug is : the tree is in a popup window, bug I can drag leaves out of the tree div even the popup window.
who can help me ??? thanks