Our state of the art Gantt chart


Post by bertwilli »

Hi,

copy following code to the codeEditor of treeGroup demo.
Select a cell in the first row and group by a column.

import { Gantt, StringHelper, ProjectModel } from '../../build/gantt.module.js?474608';
import shared from '../_shared/shared.module.js?474608';

const
    prioTextMap = { 1 : 'High', 2 : 'Medium', 3 : 'Low' },
    project     = new ProjectModel({
        loadUrl : '../_datasets/launch-saas.json',

    taskStore : {
        fields : ['priority', 'cost']
    }
});

const gantt = new Gantt({
    appendTo : 'container',
            selectionMode: {
                cell: true,
                rowNumber: true,
                column: false,
                dragSelect: true
            },

features : {
    fillHandle: true,

    treeGroup : {
        hideGroupedColumns : true,
        parentRenderer({ field, value, column, record }) {
            // Do not html encode priority columns value, it uses custom markup
            if (column.field === 'priority') {
                return `<div>${StringHelper.encodeHtml(column.text)}:</div>${value}`;
            }
            // For generated group parent, prefix with the grouped column text
            return StringHelper.xss`<div>${column.text}: ${value}</div>`;
        }
    }
},

project,

tbar : [
    'Drag columns here to group',
    { type : 'groupbar' }
],
columns : [
    {
        type       : 'wbs',
   },
    {
        type       : 'name',
    },
    { type : 'startdate' },
    { type : 'enddate' },
    { type : 'duration', width : 150 }
]
});

project.load();

BR, Bert

Attachments
20240302_162133.mp4
(2.58 MiB) Downloaded 10 times

Post by mats »

Can you please post the call stack + error message you get?


Post by bertwilli »

Uncaught TypeError: Cannot destructure property 'id' of 'e.store[ayl(...)](...)' as it is undefined.
    at RowManager.getRecordCoordsByIndex (gantt.module.js?474608:63:15115)
    at RowManager.getRecordCoords (gantt.module.js?474608:63:14903)
    at FillHandle.drawFillHandleAndBorder (gantt.module.js?474608:38:25431)
    at FillHandle.handleSelection (gantt.module.js?474608:38:20782)
    at FillHandle.syncFlexedSubCols (gantt.module.js?474608:38:18634)
    at functionChainRunner (gantt.module.js?474608:10:254442)
    at a.<computed> [as syncFlexedSubCols] (gantt.module.js?474608:10:254051)
    at SubGrid.onInternalResize (gantt.module.js?474608:63:124155)
    at SubGrid.onElementResize (gantt.module.js?474608:10:727518)
    at set width (gantt.module.js?474608:63:122650)

Post by mats »

Already fixed as part of https://github.com/bryntum/support/issues/8713, will be out asap


Post Reply