I have a situation where I am trying to select multiple checkboxes on different rows in my application. Each time I click on one checkbox, it gets selected just fine. However, when I click on another checkbox in a different row, the previously selected checkbox gets de-selected.
Here is a snippet of the HTML:
<div>
<ag-grid-angular
#dataVisGrid
style="width: 1000px; height: 500px;"
class="ag-theme-balham"
[rowData]="rowData"
[columnDefs]="columnDefs"
[rowSelection]="multiple"
[rowMultiSelectWithClick]="true"
[enableRangeSelection]="true"
(rowClicked)="onRowSelect($event)">
</ag-grid-angular>
</div>
In the data-vis-component.js file,
columnDefs = [
{headerName: 'Data Source', field: 'dataSource', sortable: true, filter: true, checkboxSelection: true},
{headerName: 'Value', field: 'value', sortable: true, filter: true},
{headerName: 'State', field" 'state', sortable: true, filter: true}
];
onRowSelect(event) {
console.log("onRowSelect:"+JSON.stringify(event));
}
Even though I can see multiple rows highlighted when I ctrl-click due to enableRangeSelection
, only one checkbox seems to be working properly.
According to the documentation, everything seems to be set up correctly. But for some reason, it's not functioning as expected. Any ideas or suggestions would be greatly appreciated!