Tree view folder & subfolder creations

Hello guys,
need to create folder in perspective tree component and after selecting particular parent folder depends on user requirements sub folders needs to create.

Pls suggest.....

The tree can be used to represent a folder structure but it doesn't have "folders" or "sub-folders". It has a list of items and each of the items can contain a list of items to give the tree structure.

Make a mockup manually, take a neatly cropped screengrab and post it here. Then explain what the user is to do and what the script is to do.

If the user is selecting a parent item then it already has children. Does it?

What item structure is to be created.

I think if you can define the problem properly that the solution will become much clearer.

@Transistor

Requirement is :
user can create n number of parent items and subitems with limitation (upto 5)
after creation of parent item & sub items depends on user selection need to pass the table data into selected item (parent item or sub item) which we are getting from params

Plus File Icon : to create items
Add to Favourite Button : to add the data into selected item
Text Field : to name the items

added my view snap here

That's going to be a little tricky and I don't know how to do it.

  1. The user will have to select a branch of the tree first before the text field and Add button are enabled.
  2. That will give you something like props.selection.0 : 0/0/1/0.
  3. You then need to convert that into something like,
    self.props.items[0].items[0].items[1].addItem(...)

Other points:
4. You have no root object so you can't add another parent.

I think that using the context-menu (right-click on the tree) might be simpler to code.