Categories | Question details Back To List | ||
onDrop - remove parent if empty Hi, I'm trying to make sure that if I drag the last tiem out of a folder, instead of the folder turning to a page, the folder should be removed from the tree, if it is empty. Anyhow, unless I'm taking the wrong approach, this almost works but the page I've dragged out of the folder never gets dropped. function onDrop(sId,tId,id,sObject,tObject) { if (skipDrag == false) { var myID = tree.getSelectedItemId(); editSite(id,myID,"move"); /*does ajax stuff*/ if (tree.hasChildren(tree.getParentId(sId)) == 1) { tree.deleteItem(tree.getParentId(sId),true); } } return true; } Answer posted by Alex (support) on Nov 10, 2009 08:00 Hello, you can try to use the following approach: var deleted = false; |