[treeList] Ensure removed item is also removed from selected set

This commit is contained in:
Nick O'Leary 2020-05-19 00:15:51 +01:00
parent 64d2e80690
commit e674d9246b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 1 additions and 9 deletions

View File

@ -320,6 +320,7 @@
item.parent.children.splice(index,1)
that._trigger("sort",null,item.parent);
}
that._selected.delete(item);
delete item.treeList;
delete(that._items[item.id]);
}
@ -467,15 +468,6 @@
item.treeList.container = container;
item.treeList.parentList = parentList;
// item.treeList.remove = function() {
// parentList.editableList('removeItem',item);
// if (item.parent) {
// var index = item.parent.children.indexOf(item);
// item.parent.children.splice(index,1)
// that._trigger("sort",null,item.parent);
// }
// delete(that._items[item.id]);
// }
var label = $("<div>",{class:"red-ui-treeList-label"}).appendTo(container);
item.treeList.label = label;