You can trigger a Dash callback from clicking on a cell with the cellClicked
property and from double-clicking on a
cell with cellDoubleClicked
property. If you use cellClicked
or cellDoubleClicked
as a callback input, when the
callback runs, you’ll have access to data about the click or double-click.
cellClicked
and cellDoubleClicked
are dicts and have the following keys:
colId
(boolean | number | string | dict | list; optional): Column where the cell was clicked.
rowId
(boolean | number | string | dict | list; optional): Row Id from the grid, this could be a number
automatically, or set via getRowId
.
rowIndex
(number; optional): Row Index, typically a row number.
timestamp
(boolean | number | string | dict | list; optional): Timestamp of last action.
value
(boolean | number | string | dict | list; optional): Value of the clicked cell.
The following example demonstrates cellClicked
. In this example, we output the cell’s data to an html.Pre
component
when the cell is clicked.
The following example demonstrates cellDoubleClicked
. In this example, we output the cell’s data to an html.Pre
component when the cell is double-clicked.
You can also trigger Dash callbacks with custom components. For more information, see:
Range selection allows Excel-like range selection of cells.
Note that range selection is an AG Grid Enterprise feature. See
the Range Selection page in the
AG Grid docs for more details.
<br>