Reputation: 307
We need to select maximum two no. of rows with out ctrl button pressing same like single row selection, if user select more than two rows than first one is deselect automatically and new one is selected. For example user first selected third and than fourth row, than click on second row apparently three rows are selected but need to bound the latest two rows. In that case third row automatically deselect and must be vanish from selectedRows collection. How we achieve that goal? Any help would be appreciated.
Upvotes: 3
Views: 2328
Reputation: 5353
You can use the rowClicked event to perform a custom selection using gridAPI selectNode function and getSelectedNodes.
To be sure to have a clean implementation disabled rowSelection in gridOptions and handle all the selection process yourself with the rowClicked event.
Event documentation : http://ag-grid.com/javascript-grid-events/index.php Grid API documentation : http://ag-grid.com/angular-grid-api/index.php
Upvotes: 1