Hi,
I am using a checkbox widjet,
issue 1: when i change the state, the other state of the checkbox is getting removed.
issue 2: When i change the states multiple times, i am getting stack is overflowed, can you please help me on this.
{
type: "widget",
width: "10px",
field: "estimatedEndDateCheckBox",
widgets: [
{
type: "checkbox",
field: "estimatedEndDateCheckBox",
onAction(props) {
const gantt = props.source.cellInfo.column.grid;
const record = props.source.cellInfo.record;
// Update the record's originalData with the new checkbox state
record.originalData.estimatedEndDateCheckBox = props.checked;
// Refresh the row to ensure the renderer is called
gantt.rowManager.refresh(record);
},
},
],
renderer(data) {
const recordData = data.record.originalData;
// Highlight rows with a hard date constraint
if (recordData?.hardDateConstraint?.EndDate) {
data.rowElement.style.backgroundColor = "#F5E8FF";
} else {
data.rowElement.style.backgroundColor = ""; // Reset background color if no hard date constraint
}
// Show or hide the checkbox based on whether the record can be locked
data.widgets[0].hidden = !recordData.canBeLocked;
// Set the checkbox state based on the record's data
data.widgets[0].checked = recordData?.estimatedEndDateCheckBox || recordData?.hardDateConstraint?.EndDate;
},
},