Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-3092 in 3.0.6.
  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    103
    Vote Rating
    6
    Andreas Samjeske is on a distinguished road

      0  

    Default 2 Minor Issues at ReorderingTree Example

    2 Minor Issues at ReorderingTree Example


    At http://staging.sencha.com:8080/examp...reorderingtree I found 2 problems:

    1.)
    - Open some folders, so that a scroll bars appears at the right of the tree.
    - Select folder "Binding" at the top.
    - Scroll down by DRAGGING the scrollbar
    Result: InfoWindow "Drag Prevent" appears at the upper right corner.

    I think InfoWindow shouldn't appear, since I am not dragging a tree item (i.e. folder "Binding").
    Recommended Solution: Don't look for selectedItem of store, but compare dragged item of event to sourceStore.getRootItems().get(0) in onDragStart.

    2.)
    - remove all leafs out of a folder by drag'n'droping them anywhere else
    Result: folder is shown as leaf and treated as leaf. You can't drop other leafs or folders on it anymore.

    I am not sure if this is the way it should be or if it is a bug or a misconfiguration. At least it is an unexpected behaivor.

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Posts
    103
    Vote Rating
    6
    Andreas Samjeske is on a distinguished road

      0  

    Default


    Any news here? Have u even recognized this thread?

    Issues are still present in GXT3.1 http://qa.sencha.com:8080/examples-d...reorderingtree

  3. #3
    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


    1) Thanks, it appears that either the drag code is a little overzealous in what it informs of a drag start, or that the example should actually query the event for which items it thinks are being dragged. While the implementation is slightly different than GXT 2.x, I'm not sure that it is different enough to qualify as a bug - the Draggable itself can't tell the difference between normal html scrollbars and other elements, so a drag is a drag.

    2) is definitely a bug in the example itself - it is up to code that uses the tree to indicate if something should be drawn as a node or as a leaf.

    Do you have a concrete DnD bug to go with these, or are these just issues you noticed while working with our examples?

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    103
    Vote Rating
    6
    Andreas Samjeske is on a distinguished road

      0  

    Default


    Quote Originally Posted by Colin Alworth View Post
    ... so a drag is a drag.
    Sure it is.
    But i think, u should compare the dragged item to of DragEvent to sourceStore.getRootItems().get(0). As stated above, that might be better than comparing selectedItem to sourceStore.getRootItems().get(0).

    Quote Originally Posted by Colin Alworth View Post
    Do you have a concrete DnD bug to go with these, or are these just issues you noticed while working with our examples?
    No, I haven't, atleast not at the moment. I noticed these problems when playing around with ur examples, verifiing that some others bugs have been fixed.
    We use tree in a kind of weird way. So, we had to define what is a leaf and what is folder for ourselves anyway.

  5. #5
    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


    But i think, u should compare the dragged item to of DragEvent to sourceStore.getRootItems().get(0). As stated above, that might be better than comparing selectedItem to sourceStore.getRootItems().get(0).
    Right, I think that is what I said - in any case, we should change it.

    I've filed this internally to clean up the examples a bit, though it isn't likely to have a very high priority while there are other bugs in the framework itself.

  6. #6
    Sencha - GXT Dev Team
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    403
    Vote Rating
    15
    branflake2267 will become famous soon enough

      0  

    Default


    First Issue: we have a fix that will come out in the next release.

    Second Issue: Folder turns to leaf.

    The tree will automatically turn the folder into a leaf if there are no children or setLeaf is false. So with this, there are two ways to control the folder to leaf changing behavior.

    The first way is to override hasChildren. If the leaf has children it will look like a folder. Keeping track of the leaf type in the model might be needed.

    Code:
    final Tree<NamedModel, String> sourceTree = new Tree<NamedModel, String>(sourceStore, props.name()) {      @Override
          protected boolean hasChildren(NamedModel model) {
            return super.hasChildren(model); // return true to look like a folder or false to look like a leaf
          }
        };
    Second way to change the leaf look is setLeaf(model, true) and might look similar to the below snippet.

    Code:
        NamedModel model = ...;
        sourceTree.setLeaf(model, true);

Thread Participants: 2

Tags for this Thread