Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    23
    Vote Rating
    0
    pete_by is on a distinguished road

      0  

    Exclamation [CLOSED] Tree: cannot add leaf as a child of leaf node via drag drop: node disappers

    [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
        }
      ...
    }
    ...

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Thanks for the report - we're looking into it.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    23
    Vote Rating
    0
    pete_by is on a distinguished road

      0  

    Default


    Quote Originally Posted by Colin Alworth View Post
    Thanks for the report - we're looking into it.
    I'm not quite sure that the isChildrenRendered property is the only reason for this issue, as far as I tried to change it in debugger to true, but that did not produce any effect so far. The internal logic of the widget is a bit sophisticated to me from the first view, but I expect to have time to get into soon.

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    23
    Vote Rating
    0
    pete_by is on a distinguished road

      0  

    Default


    Looks like the problem in store and my data model syncronisation during nodes moving. In Tree.onAdd method:

    int parentChildCount = parent == null ? store.getRootCount() : store.getChildCount(parent);

    parentChildCount= 1 after dropping one leaf node on another but parent.getChildren() is still empty but should be instead contain node that passed in event.getItems(). Looks I have to look close to the TreeStore and how it use properly.

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    23
    Vote Rating
    0
    pete_by is on a distinguished road

      0  

    Default


    Looks like the bug submission is irrelevant, my error was not keeping my own tree model in sync with TreeStore model.

  6. #6
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Thanks for the update, and for all of the other testing you've done. Let us know if another bug shows itself - we'll hopefully get those other tree bugs closed out this week.

Thread Participants: 1

Tags for this Thread