in my grid I would like to have a multiple selection, but I want only the actually double clicked row to be used in a certain event. So, getSelectedRows() couldn't do the job (at least used alone).
Any ideas?
React Data Grid: Row Selection. Select a row by clicking on it. Selecting a row will remove any previous selection unless you hold down Ctrl while clicking. Selecting a row and holding down Shift while clicking a second row will select the range.
Property rowSelection='multiple' is set to enable multiple row selection. Selecting multiple rows can be achieved by holding down Ctrl and mouse clicking the rows. A range of rows can be selected by using Shift .
The easiest way to get a Row Node is by its Row ID. The ID is either provided by you using the grid callback getRowId() , or generated by the grid using an internal sequence.
Are you looking for the event rowDoubleClicked?
https://www.ag-grid.com/javascript-grid-events/
It's used like so:
gridOptions = {
onRowDoubleClicked: doSomething
}
function doSomething(){
alert('I did something')
}
The even will also pass the row data if you want to use that in the function:
gridOptions = {
onRowDoubleClicked: doSomething
}
function doSomething(row){
console.log(row);
console.log(row.data);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With