Hello, We need to add custom add button in BryntumGrid cell (Please refer screenshot). For that we have added rendered in columns like this ->
{
type: 'tree',
text: 'Group/Task',
cls: 'name-header-grid',
minWidth: '600px',
field: 'name',
autoHeight: true,
touchConfig: { editor: false },
htmlEncode: false
renderer: (props: any) => {
if (props.record?.data?.parentId == null) {
return (
<div className="parent-div" style={{}}>
<div className="child1-div">
<span>{props.value}</span>
</div>
<div className="child2-div" style={{ marginTop: '-5px' }}>
<button
className="addTask-button"
onClick={() => handleAddNewTask(props.record)}
>
+
</button>
</div>
</div>
);
} else {
return (
<div className="edit-parent">
<div>
<span>{props.value}</span>
</div>
<div className="edit-wrap">
<i
className="b-fa b-fa-pencil"
onClick={() => handleEdit(props.record)}
></i>
</div>
</div>
);
}
};
}
After adding this we are getting error "Uncaught TypeError: Cannot read properties of undefined (reading 'onCellClick')"
Can you please help us, like how we can prevent this error?