Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha User
[CLOSED] Tree: cannot add leaf as a child of leaf node via drag drop: node disappers
Though it is possible to drag-and-drop leaf node of a tree to another non-leaf node, drag-and-dropping leaf node to another leaf node makes the dragged one disappear after dropping it. The problem is that initially all the leaf nodes have TreeNode#isChildrenRendered property turned off (false). When the leaf is dropped to another leaf node this property does not changes. Thus the implementation of Tree.onAdd works incorrectly:
Code:
protected void onAdd(StoreAddEvent<M> event) {
...
if (isOrWasAttached()) {
// event.getItems().get(0) is a dropped leaf-node
// parent is a target leaf-node
M parent = store.getParent(event.getItems().get(0));
TreeNode<M> pn = findNode(parent);
if (parent == null || (pn != null && pn.isChildrenRendered())) {
// we'll never get here because pn.isChildrenRendered() == false
...
// rendering the children nodes
}
...
}
...