Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    update folder of tree after leaf removing

    Hello,

    I'm using smartGWT 3.0 version and have following problem:

    I have TreeGrid that is bind with datasource recieveing data from server:

    Code:
    TreeGrid projectTree = new TreeGrid();
    final Tree tree = new Tree();
    tree.setModelType(TreeModelType.PARENT);
    tree.setNameProperty(CampaignProjectDescriptor.NAME);
    tree.setIdField(CampaignProjectDescriptor.ID);
    tree.setParentIdField(CampaignProjectDescriptor.PARENT + "." + CampaignProjectDescriptor.ID);
    tree.setDefaultIsFolder(false);
    projectTree.setDataProperties(tree);
    when I delete some node of that tree in other smartGWT widget, it's automatically removed also from tree, that's very good, problem occurs when I delete node that has some parent and that parent has only 1 child - then leaf is removed from tree but former parent node has still parent icon even it has no child.
    When I refresh tree it's rendered correctly

    Could you please advice me how to achieve automatic changing parent node type after children removing?

    thanks,

    michal

    #2
    A parent that loses all it's children is not the same thing as a leaf, so this is expected.

    To convert it to a leaf you would need to remove the folder and add a leaf as a replacement.

    Comment

    Working...
    X