Results 1 to 6 of 6

Thread: The following method does not work: replaceSubTree in class TreeStore.

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Russia, Smolensk
    Posts
    11

    Default The following method does not work: replaceSubTree in class TreeStore.

    The following method does not work: replaceSubTree in class TreeStore. After his call, you can not collapse or expand the tree nodes. Thanks

  2. #2
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,165

    Default

    I'm investigating and will get back shortly.

    Brandon

  3. #3
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,165

    Default

    I'm not able to replicate the issue yet. Could you provide some more information to help us drill?

    1. Could I see your code configuration that has the issue?
    2. How are you getting the TreeNode children to add to the replaceSubTree?

    Thanks,
    Brandon

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Location
    Russia, Smolensk
    Posts
    11

    Default

    Here is a simple example:
    Code:
    FolderDto folder = new FolderDto(1, 0, "ROOT");
    List<BaseDto> children = new ArrayList<BaseDto>();
    ChildrenDto childrenDto = new ChildrenDto(2, 1, "test 2222");
    children.add(childrenDto);
    ChildrenDto childrenDto2 = new ChildrenDto(3, 1, "test 3333");
    children.add(childrenDto2);
    folder.setChildren(children);
    store.add(folder);
    store.add(folder,children);
    store.replaceSubTree(folder, children); After his call, you can not collapse or expand the tree nodes.

  5. #5
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,165

    Default

    I wouldn't expect that to work because children should be of type 'List<? extends TreeNode<M>> children'. There is an unwrap function immediately after that. I would suspect some other routine would need to be used if using the model type directly.

    Maybe replaceChildren(M parent, List<M> children) would be the best choice.

    Would the other method work for you?

    Brandon

  6. #6
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,165

    Default

    Looks like I had an oversight and BaseDto extends TreeNode. Looks like this may be a bug. I'll take another look. Brandon

Posting Permissions

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