Skip to content

Get all tree above a certain node #6

@maeishoj

Description

@maeishoj

Hi there,

I am using ui-tree for managing groups in my project and I have a full tree of a group on one side, and i can select various nodes and then add them to a new list. However I am looking for a way to only add a the selected nodes and all the other ones above the last selected node in the hierarchy.

so say i have this:

Company name

  • Board of directors
  • Finance
    ---- Global Finance
    -------- Financial department
    -------- Region Asia Pacific
    ---- Tax and co

and I select Board of Directors and Financial department, I want to have in a new ui-tree

Company name

  • Board of directors
  • Finance
    ---- Global Finance
    -------- Financial department
    -------- Region Asia Pacific

Is there an easy way to do this? how would you guys go about it?

Right now I am only copying the whole structure over and showing in bold the selected groups and disabling the unselected ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions