Results 1 to 2 of 2

Thread: GXT Async Tree

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Cremona Italy
    Posts
    37

    Default GXT Async Tree

    Hello everyone,

    Some days ago I noticed a weird behaviour on the async tree.
    You can verify it also in the live examples:
    http://www.sencha.com/examples/#ExamplePlace:asynctree

    Try open 2 root until third level (example Brahms>Concertos and Mozart>Concertos)
    Now close both only at the root (Brahms and Mozart)
    If you then open one the other opens also.

    My guess is that "on appearence refresh" if a node is expanded, even if is not part of the node i'm expanding, it will get shown (can't confirm, haven't found evidence of this in the code).

    Anyway I'm looking for an idea to get rid of this behaviour but so far I come up with nothing. Any hints?

    Regards

  2. #2
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Cremona Italy
    Posts
    37

    Default

    Current workaround (unfortunately there isn't a fireEvent flag so I had to use a custom global flag).

    The boolean variable:
    Code:
    private boolean collapsing = false;
    and this Handler (tree is a Tree<CategoryDto, String>):
    Code:
    tree.addBeforeCollapseHandler(new BeforeCollapseItemHandler<CategoryDto>() {
        @Override
        public void onBeforeCollapse(BeforeCollapseItemEvent<CategoryDto> event) {
            if (!collapsing) {
                collapsing = true;
                tree.setExpanded(event.getItem(), false, true); //THIS COLLAPSE THE NODE DEEPLY
                collapsing = false;
            }
        }
    });
    If there is a cleaner way please let me know.

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •