Page 1 of 1

[REACT] add button conditionally Button Inside grid

Posted: Tue Mar 14, 2023 12:17 pm
by harshalkhode1703

hii,
i am using bryntum gantt and want to add a button with every task.
but conditinally
I want to add button only with parent task.
how can i achive that

example image:

Screenshot from 2023-03-14 15-45-31.png
Screenshot from 2023-03-14 15-45-31.png (31.37 KiB) Viewed 203 times

according to the image i want to add button only with task named "parent" and "Task Group 2" but not with their children tasks.


Re: [REACT] add button conditionally Button Inside grid

Posted: Tue Mar 14, 2023 1:42 pm
by tasnim

Hi,

You could use https://bryntum.com/products/gantt/docs/api/Grid/column/Column#config-renderer and put a condition inside and and add your logic inside of your condition

Example

renderer : ({ record }) => {
	if (!record.isLeaf) {
		// logic here
	}
}

https://bryntum.com/products/gantt/docs/api/Gantt/model/TaskModel#property-isLeaf

I hope this will help


Re: [REACT] add button conditionally Button Inside grid

Posted: Thu Mar 16, 2023 8:16 am
by Animal

That would be better done with an ActionColumn: https://bryntum.com/products/gantt/docs/api/Grid/column/ActionColumn