Our pure JavaScript Scheduler component


Post by mos »

Thanks Johan for the clarification and pointer.

May I ask if the referenced approach also works for deeper groupings?
In the example you gave, both "Top" and "Ones" are static.

The intent is for:

  • "Top" (...Top 2, Top 3... etc) to be dynamic resourceStore items,
  • "Ones" & "Others" to be static groups under all Tops for each resource item.
  • children to be resource store item groups under Ones & Others associated filtered to it's respective "Top" resource.

My attempts to reshape the data object using links (grouping resource leaf nodes under resource parents), throws an error when nested under anything other than a static parent.

I've included a contrived 2-level snippet below.

let leafNodes = resourceStoreInstance.leaves.map(l => l.link());
    let parentNodes = leafNodes.filter(l => l.resourceType == 'parent');
    let childNodes = leafNodes.filter(l => l.resourceType == 'child');
    
let newStructureItem = parentNodes.map(p =>{ p.children = childNodes.filter(c => c.parentId == p.parentId); return p })

Error:

GroupErrro.png
GroupErrro.png (22.9 KiB) Viewed 64 times

Thanks!


Post by johan.isaksson »

Hi,

I am afraid that a linked leaf is still a leaf, and cannot (currently) be used as a parent.

If you need "non-static" parents like in your snippet, we could implement it as part of our Professional Services, please reach out to sales@bryntum.com for more details and a quote.

Best regards,
Johan Isaksson

Post Reply