Posted 18 September 2018, 11:50 am EST
I have FlexGrid with radio buttons in its cells. On radio button change I am modifying dataItem property that is NOT bound to the grid. The problem is the value of that property is not stored in the grid. How do I make FlexGrid to retain the value of the modified dataItem property?
Below is function that set property value of dataItem. When I select radio button in column 1 of the grid updateDataItem method gets called and it logs the following output to the console.
row 0 column 1 value true
(2) row 0 column 1 value false
After iterating the first row the column1 value is set to correct value of. After iteration continues to second and third row the column1 value get set to initial value of false.
Why does not grid retain the value and changing it to false? I tried using beginUpdate and endUpdate but that did not work. What do I need to do to make grid retain the value set on dataItem property?
updateDataItem(flexGrid) {
flexGrid.rows.forEach((row, rowIndex) => {
for (let columnIndex = 1; columnIndex < flexGrid.columnHeaders.columns.length; columnIndex++) {
const match = row.dataItem['column' + columnIndex].id === row.dataItem.column0.selectedId;
row.dataItem['column' + columnIndex].value = match;
}
console.log('row 0 column 1 value ' + flexGrid.rows[0].dataItem.column1.value);
});
return [];
}
thank you
