简体   繁体   中英

Adding one children to more than one parent in angular gantt

I am using angular gantt for my master thesis and I am very pleased with it so far. But now I came across an issue which I can't fix that easily: I have modified the data object in such a way, that the first entry of the tree is always a person in charge of some tasks and when I open the tree I can see all the tasks from this person. But now it could happen, that more persons in charge have the same task. So is it possible to add one task to more than one person in charge? Or generally speaking is it possible to add the same children to more than one parent? The documentation says, it is not supported, but I thought maybe someone with a bit know how about the topic as a clever idead to solve this problem anyway. Any help will be appreciated. Cheers!

In Angular Gantt, you can't have a child belongs to different parents. One way to work around that is as follows:

{"name": "person1", "children": ["item1", "item2"]}, {"name": "item1", "tasks": [{ "id": "101", "name": "Description", "color": "#f1c232", "from": "...", "to": "..."} ]}, {"name": "item2", "tasks": [{ "id": "102", "name": "Description", "color": "#f1c232", "from": "...", "to": "..."} ]}, {"name": "person2", "children": ["item2 "]}, {"name": "item2 ", "tasks": [{ "id": "103", "name": "Description", "color": "#f1c232", "from": "...", "to": "..."} ]}, ... ...

Notice that for 'person2', I added a space after 'item2' so that visually the gantt chart will show 'item2' but the child item is actually 'item2 '. If person3 has the same child 'item2', add 2 spaces after 'item2' and so forth. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM