ag-grid-enterprise
ag-grid-enterprise copied to clipboard
Suppress onRowClicked when clicking on cell with onCellClicked
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/ceolter/ag-grid-enterprise/blob/master/CONTRIBUTING.md#question
Current behavior
- Having a
onRowClicked
event handler in the grid options - Having a
onCellClicked
event handler in a column definition - Clicking a cell with a
onCellClicked
handler fires theonRowClicked
event first, then theonCellClicked
event
Example:
- Table shows a list of employees
- Column "dept. no." has an
onCellClicked
handler which navigates to the department of that employee -
onRowClicked
event handler navigates to a details view of the employee
Expected behavior
Either
- Suppress
onRowClicked
event generally when clicking on a cell withonCellClicked
event
or
- Adding an option to the column definition, e. g.
suppressRowClicked: true
or
- Add a way to check in the
onRowClicked
event which column has been clicked, to see if there's a cell click handler and prevent the row click event from being executed
Minimal reproduction of the problem with instructions
- Demo: https://next.plnkr.co/edit/Oyu0KSZ2WoudJQyI?preview
- Clicking on a cell in the column "Make" will first fire the
onRowClicked
event, thenonCellClicked
and currently there's no way to preventonRowClicked
What is the motivation / use case for changing the behavior?
We had this functionality in our old datatables.net tables (requested by our customer) and we are now migrating that table to ag-grid.
Please tell us about your environment:
- ag-Grid-Enterprise version: 22.1.1
- Browser: all
- Language: all
Hi, is there any updates on this matter?