Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/lib/components/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions src/lib/fragments/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -1578,6 +1593,7 @@ export function DashAgGrid(props) {
onSelectionChanged={onSelectionChanged}
onCellClicked={onCellClicked}
onCellDoubleClicked={onCellDoubleClicked}
onRowDoubleClicked={onRowDoubleClicked}
onCellValueChanged={debounce(
afterCellValueChanged,
CELL_VALUE_CHANGED_DEBOUNCE_MS,
Expand Down