Hi everyone!
I have a a WebApp that is using AG Grid Table in it.
Because I want to be able to select multiple rows I am using "rowSelection": "multiple"
in dashGridOptions
.
What I am also using is checkbox "checkboxSelection": True
in columnDefs
.
I want the user to be able to select multiple rows via checkbox column.
The problem I am encountering is that clicking on any row removes all selections.
Example: I selected multiple rows via checkbox, then I click on some random row, that random row gets selected in the checkbox, other previously selected rows are now deselected.
How do I prevent that from happening?
When I click on the row, I want the row to be highlighted as it is now, but I do not want a check in checkbox, I don’t want deselection of selected rows (if any). Clicking on the row shouldn’t have selection at all. Just highlighting the row is enough.
table = grid.AgGrid(
id="sql-table",
rowData=dff.to_dict("records"),
columnDefs=column_info.month_columnDefs,
defaultColDef={
"resizable": True,
"sortable": True,
"filter": True,
"floatingFilter": True,
"editable": True,
"minWidth":125
},
columnSize="sizeToFit",
dashGridOptions={
"undoRedoCellEditing": True,
"rowDragManaged": True,
"animateRows": True,
"rowDragMultiRow": True,
"rowSelection": "multiple",
"rowDragEntireRow": True,
},
)