Posted 18 September 2022, 9:07 pm EST - Updated 3 October 2022, 2:41 am EST
Hi Team, I want to sync the grid row selection with checkbox selection. Whenever we click a row we need to select that row’s checkbox. Can I know how can we extend the data grid to have below row selection features.
- Selecting a row should select the corresponding checkbox.
- Clicking on a selected row should unselect the row and uncheck the checkbox.
- If we drag the cursor currently it will only multi-select the rows, can we multi-check the checkboxes as well?
I have tried to use the SelectionChanged event callback as below, It seems working fine with the single row clicks. However, when I drag through the records it not working properly.
let theGrid = GridOS.GridObject[0].grid;
function onSelectionChanged (s, e) {
theGrid.deferUpdate(function () {
console.log(e.panel._rows[e.row]);
if(theGrid._rows[e.row] && theGrid._rows[e.row].dataItem){
theGrid._rows[e.row].dataItem.os_isSelected = !theGrid._rows[e.row].dataItem.os_isSelected;
}
});
}
Kindly let us know if this is possible. Thank you very much!