Our state of the art Gantt chart


Post by MauriceLapre »

Hi,

I'd like to implement grouping in the Gantt, but struggling how to do this. From the documentation I see it's a Grid feature and not a Gantt feature, so adding it to gantt.features does not seem to do anything, neither does adding it to gantt.grid.features.

I'd like it to be changeable via the UI so like this documents: https://www.bryntum.com/docs/gantt/#Grid/feature/Group

Store grouping seems to work though. As an alternative, can this be activated/deactivated by a user command somehow?

Thanks!

Post by mats »

Gantt is a tree and cannot be grouped the way you intend. If you need this, instead use a Scheduler and use its Group feature.

Post by MauriceLapre »

Howcome being a tree is blocking that? It's about collecting all tasks based on the same value for a specific field, and adding those as childs to an imaginary parent, right? It's possible to have 3 layers or more...

Post by mats »

Can you please show the UI you're looking for?

Post by MauriceLapre »

I guess just like the Grid Grouping demo:
https://www.bryntum.com/examples/grid/grouping/

Grouping functionality on the parent nodes on a certain column in a Gantt tree grid . Something like this I've created, grouping on "Object". Iterate through parent nodes, find all unique "Object" codes, create a record for each unique one and add nodes to those as childs:
Bryntum Gantt - 008.png
Bryntum Gantt - 008.png (69.69 KiB) Viewed 2213 times

Post by mats »

I think that's a good solution, any issues with using the tree for your purpose?

Post by MauriceLapre »

No real issues on the tree (yet), but the parent has to be a task so it needs some fields with contents. Not the worst, but in the Grouping demo on Grid the Group header looks better.

Post by MauriceLapre »

Hi,

The grouping is kind of working now. But ungrouping is not...
I'm iterating through the group tasks, and calling removeChild(record.children, true, true) as described here https://www.bryntum.com/docs/gantt/#Core/data/mixin/TreeNode#function-removeChild.

My goal is to detach all children from the group tasks, then remove the group tasks from the task store to end up with the "ungrouped" set again. But removeChild actually removes the task from the store completely, even with isMove set to true. Should detaching be possible like this, or maybe otherwise?

Thank you.

Post by alex.l »

Hi MauriceLapre,

Looks like you need to change the value in the field you are grouping by. As example, if you group by color, clear the color value and this record will be ungrouped.

Thanks,
Alex

All the best,
Alex


Post Reply