а

Resources with same parent


#1

I’ve got an array of resources with 2 parents. I have 3 children and two of those belong to each of the parents. Here is the schema:
const resources = [
{
$level: 0
$open: true
$rendered_parent: 0
id: 15012
name: “Big Data Team”
open: true
owner_id: 0
parent: 0
text: “15012”
},
{
$level: 1
$open: true
$rendered_parent: 15012
id: 5001
name: “Jane Browne”
open: true
owner_id: 15012
parent: 15012
text: “5001”
},
{
$level: 0
$open: true
$rendered_parent: 0
id: 15013
name: “AI Development Team”
open: true
owner_id: 0
parent: 0
text: “15013”
},
{
$level: 1
$open: true
$rendered_parent: 15013
id: 5001
name: “Jane Browne”
open: true
owner_id: 15013
parent: 15013
text: “5001”
},
{
$level: 1
$open: true
$rendered_parent: 15013
id: 5001
name: “John Smith”
open: true
owner_id: 15013
parent: 15013
text: “5002”
}
]

But the Gantt instance only displays the duplicate child under one of the parents.

Is there something wrong with the above array

?


#2

Hello Rob,
Looks like, you have the same IDs for the resources. Because of that, the resource will never appear under a different parent.
Unfortunately, Gantt doesn’t support a feature of displaying duplicate resources nor duplicate tasks even if you change the IDs.
You need to implement a custom solution if you need that.