Our state of the art Gantt chart


Post by haradeep mara »

Hi Team,

I am creating custom columns in addnew using processComboStoreConfig hook and able to successfully add the columns using below code -

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

new Gantt({
    appendTo          : 'container',
    dependencyIdField : 'sequenceNumber',
    rowHeight         : 45,
    tickSize          : 45,
    barMargin         : 8,
    project           : {
        autoLoad  : true,
        transport : {
            load : {
                url : '../_datasets/launch-saas.json'
            }
        }
    },

columns : [
    { type : 'name', width : 250 },
	{
            type: 'addnew', 
            width : 200,
            processComboStoreConfig: ({config, column}) => {
                config.data.push([{
                    text : 'Test',
                    value : {
                        text : 'Test',
                        type : 'name',
                        width : 200,
                    }
                }])
            }
        },
],

// Custom task content, display task name on child tasks
taskRenderer({ taskRecord }) {
    if (taskRecord.isLeaf && !taskRecord.isMilestone) {
        return StringHelper.encodeHtml(taskRecord.name);
    }
}
});

But when I try to add those columns by right-click on a column -> click columns I am not able to view the newly added columns. I am using vanillaJS version of gantt.
How to resolve this issue?

Thanks


Post by tasnim »

Hi,

I do see them in the column picker's list

Screenshot 2024-03-29 142706.png
Screenshot 2024-03-29 142706.png (25.59 KiB) Viewed 215 times

Is it possible to share a video of how you are reproducing it?


Post by haradeep mara »

Can you share your code?
I am not able to see it when I use the above code.

Screenshot 2024-03-29 140528.png
Screenshot 2024-03-29 140528.png (167.73 KiB) Viewed 214 times

Post by tasnim »

I used the same code that you used.
To make it appear in the column picker's list, first you need to select it from the 'add new' column and then you'll be able to see it in the list.

All The best,
Tasnim


Post by haradeep mara »

Our requirement is to show all available columns in the column picker's list. How to achieve that?


Post by tasnim »

Hi,

You can achieve it by defining all the columns you need into the columns config
Make them hidden which you want them to be hidden initially!

columns : [
	...
	{
		type : 'name',
		text : 'Name',
		width : 250,
		hidden : true
	}
]

And then you can see it in the column header menu

Hope This helps.

Please let us know if you have any other questions or concerns.

Attachments
Screenshot 2024-03-29 201949.png
Screenshot 2024-03-29 201949.png (22.09 KiB) Viewed 190 times

Post by haradeep mara »

Thanks for the solution.
Also, I want to show a few columns initially(using column config) but donot want the option to select those columns from the column header menu.

How to achieve this?


Post by ghulam.ghous »

If I understood correctly, you do not want to show some columns inside the columnPicker https://bryntum.com/products/grid/docs/api/Grid/feature/ColumnPicker (where you can toggle to show and hide the column) inside headerMenu. If yes you can always use hideable https://bryntum.com/products/grid/docs/api/Grid/column/Column#config-hideable config on the columns to include exclude columns from the list.


Post Reply