diff --git a/src/lib/components/AgGrid.react.js b/src/lib/components/AgGrid.react.js index ce2e1c3..3c18229 100644 --- a/src/lib/components/AgGrid.react.js +++ b/src/lib/components/AgGrid.react.js @@ -702,6 +702,31 @@ DashAgGrid.propTypes = { timestamp: PropTypes.any, }), + /** + * Row is double clicked. + */ + rowDoubleClicked: PropTypes.shape({ + /** + * data object from the double-clicked row + */ + data: PropTypes.any, + + /** + * rowIndex, typically a row number + */ + rowIndex: PropTypes.number, + + /** + * Row Id from the grid, this could be a number automatically, or set via getRowId + */ + rowId: PropTypes.any, + + /** + * timestamp of last action + */ + timestamp: PropTypes.any, + }), + /** * The actively selected rows from the grid (may include filtered rows) * Can take one of three forms: diff --git a/src/lib/fragments/AgGrid.react.js b/src/lib/fragments/AgGrid.react.js index a51252c..d772a40 100644 --- a/src/lib/fragments/AgGrid.react.js +++ b/src/lib/fragments/AgGrid.react.js @@ -911,6 +911,21 @@ export function DashAgGrid(props) { [customSetProps] ); + const onRowDoubleClicked = useCallback( + ({data, rowIndex, node}) => { + const timestamp = Date.now(); + customSetProps({ + rowDoubleClicked: { + data, + rowIndex, + rowId: node.id, + timestamp, + }, + }); + }, + [customSetProps] + ); + const onCellValueChanged = useCallback( ({oldValue, value, column: {colId}, rowIndex, data, node}) => { const timestamp = Date.now(); @@ -1578,6 +1593,7 @@ export function DashAgGrid(props) { onSelectionChanged={onSelectionChanged} onCellClicked={onCellClicked} onCellDoubleClicked={onCellDoubleClicked} + onRowDoubleClicked={onRowDoubleClicked} onCellValueChanged={debounce( afterCellValueChanged, CELL_VALUE_CHANGED_DEBOUNCE_MS,