Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ag-grid: Get double clicked row data within a multiple selection

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?

like image 712
Igino Boffa Avatar asked Dec 12 '16 11:12

Igino Boffa


People also ask

How do you get the selected row in Ag grid react?

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.

How do I select multiple rows on Ag grid?

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 .

How do you get rowNode on Ag grid?

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.


1 Answers

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);
}
like image 120
Jarod Moser Avatar answered Oct 05 '22 23:10

Jarod Moser