Our state of the art Gantt chart


Post by Sureka »

Hi,

I need to seperate the default Lag column into two seperate columns. One for only the number and another column as a combo that contains items as days,hours,mins.
example: In the image, Lag column should display only numbers and in UoM column I need to display a combo contains this[ hours,days,mins ] where I have to select and display it. How I can do it

Attachments
Screenshot (244).png
Screenshot (244).png (26.22 KiB) Viewed 430 times

Post by pmiklashevich »

The grid is not configurable. Ticket here: https://github.com/bryntum/support/issues/468
Though there is an option to configure columns dynamically. You can find the workaround here: viewtopic.php?p=70799#p70799

P.S. the link refers to premium forum, so copy the solution here:
beforeTaskEditShow handler:

    listeners : {
        beforeTaskEditShow({ editor }) {
            if (!editor.initialized) {
                editor.initialized = true;

            const
                successorsGrid = editor.widgetMap.successorstab.grid,
                predecessorsGrid = editor.widgetMap.predecessorstab.grid;

            successorsGrid.columns.first.remove();
            successorsGrid.columns.insert(0, {
                text       : 'Task ID',
                flex       : 1,
                editor     : false,
                htmlEncode : false,
                renderer({ record : dependency }) {
                    return dependency.fromEvent.id;
                }
            });

            predecessorsGrid.columns.first.remove();
            predecessorsGrid.columns.insert(0, {
                text       : 'Task ID',
                flex       : 1,
                editor     : false,
                htmlEncode : false,
                renderer({ record : dependency }) {
                    return dependency.toEvent.id;
                }
            });
        }
    }
},

Please apply the same approach to adjust Lag column and add one more column to the grid.

Pavlo Miklashevych
Sr. Frontend Developer


Post by Sureka »

Thank you


Post Reply