60
Views
2
Comments
Solved
Creating group with zTree
Question

Hello guys!

I am implementing a film tree and for each film there is its genre. So I'm interested in using the zTree component that exists in Forge.

The component allows me to have Drag and Drop, OnClick and Dynamically Save the changes I made to the tree.

I made the implementations as there is in the example. I can already choose by ID, which movie will be listed in my details.


What I don't have experience to implement using the component is:

1. When loading the tree, separate my films by genre in the tree structure. As I have the columns in the table.

2. When using Drag and Drop on the tree, click on the button to save that change I made to the nodes.



I am forwarding the OML, to get a better understanding and help of ideas for implementation.


Thank you!

ZTreeDanilo.oml
2020-03-05 09-05-43
Vaibhav Shukla
Solution

Hi Danilo Vilarinho ,


The configuration in your case is incorrect the Jquery used in the component receives a combined list values parent -> leaf synchronously.  The data needs to be inserted in a list variable first for parent i.e Genre in your case then related movies then the second genre and so on.

Also you need to change the Entity structure to make genre static.

Please check the attachment for your 1st problem and find the solution for the second yourself by comparing it with the component demo.


Regards

ZTreeDanilo1.oml
UserImage.jpg
Danilo Vilarinho

vaibhav shukla wrote:

Hi Danilo Vilarinho ,


The configuration in your case is incorrect the Jquery used in the component receives a combined list values parent -> leaf synchronously.  The data needs to be inserted in a list variable first for parent i.e Genre in your case then related movies then the second genre and so on.

Also you need to change the Entity structure to make genre static.

Please check the attachment for your 1st problem and find the solution for the second yourself by comparing it with the component demo.


Regards

 

 Thanks for the feedback vaibhav shukla!


That way I would have to manually create all my genres. This is not the ideal scenario. I can solve without using the static genre.

I understood the logic when he says that I need to define the father first and then the children.

In the attachment there is no relationship between the parent node and the child node. I will make some changes here and any news will come back here.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.