Posted 11 October 2018, 7:31 am EST
Hello,
I have flex grid with radio buttons in rows, columns and headers. When all rows in the same column get selected the radio button for this column should get selected. If one radio button in the column is deselected the header radio button should get deselected.
I have selecting of the header radio button when last row in the column get selected working. What is not working is when I deselect one row radio button the header radio button stays selected until I drag and extend the page. Then it gets deselected. Please help me figure out how to get header radio button get deselected.
Below is snippet of my code. selectionChanged method gets called with column number when row radio button selection changes. Note the setTimeout. Without it the the header radio button does not get selected when all rows for the column get selected.
selectionChanged(column: number, selectedId: number) {
setTimeout(() => {
this.setSelectAll(column);
});
}
setSelectAll(column: number) {
const selectAll = this.flexGrid.rows.every((row) => {
return row.dataItem['column' + column].value;
});
const input = this.flexGrid.columnHeaders.getCellElement(1, column).firstChild as HTMLInputElement;
input.checked = selectAll;
input.indeterminate = false;
}
thank you