Our state of the art Gantt chart


Post by ahmad.siddique »

Hi everyone.

I have created a custom column in Bryntum Gantt of type "check".
I want to call an API on checkbox change but I can't find a suitable event for it.

I also looked through the forum and found a solution but it's not working for me.

Screenshot 2024-03-15 at 3.13.28 PM.png
Screenshot 2024-03-15 at 3.13.28 PM.png (91.62 KiB) Viewed 91 times

my code for checkbox column

const onCheckColumnToggleHandler = ({record, column}) => {
            console.log('column: ', column);
            console.log('record: ', record);
        };
        ganttInstance?.on('onCheckColumnToggle', onCheckColumnToggleHandler);

const newColumn = {
                    ...(type && {type}),
                    ...(format && {format}),
                    ...(align && {align}),
                    ...(foundWidth ? {width: foundWidth.width} : {autoWidth: false}),
                    text: customField.title,
                    field,
                    uniqueName: field,
                    custom: true,
                    hidden: false,
                    customFieldType: customField.type,
                    ...(!modifiedCustomFields.includes(customField.type) && {...configs}),
                    ...(type === 'check' && {
                        listeners: {
                            toggle: 'up.onCheckColumnToggle',
                        },
                    })
                    columnStore?.add(newColumns);

I am getting error

Uncaught TypeError: Cannot read properties of undefined (reading 'handler')
    at CheckColumn.trigger (chunk-SAZ56NKO.js?v=481a05dc:5204:33)

Post by tasnim »

Hi,

You can listen to this https://bryntum.com/products/gantt/docs/api/Grid/column/CheckColumn#event-toggle

{
	type : 'check',
	listeners : {
		toggle() { ... }
	}
}

Best regards,
Tasnim


Post by ahmad.siddique »

thanks it worked


Post Reply