How can I delete item from a nested XUL tree? [closed]
-
05-10-2019 - |
سؤال
I created a nested tree using XUL (no database was used to store items). I want to delete items from this tree by selecting the item (only 1 at a time) then click delete. I wrote Javascript function to delete as following but it does not work.
function delete(){
var tree = document.getElementById("treeId");
currentPos = tree.currentIndex;
var currentItem = tree.contentView.getItemAtIndex(currentPos);
var parent = currentItem.getParent();
parent.removeChild(currentItem);
}
I guess getParent() is not the right method but did not find any other method. Can someone give me some hints please. Thanks
المحلول
Problem solved. It was my mistake. I just realized that delete cannot be used as a name of function.
لا تنتمي إلى StackOverflow