None of the past suggestions worked for me. AG Grid may have changed the API behavior. Even event.stopPropagation()
on onCellClicked
would not stop onRowClicked
from firing.
What I ultimately did was to remove onRowClicked
altogether and handle everything in onCellClicked
. onRowClicked
does not have an attribute on which column the click event generated from, onCellClicked
does!
function cellClickedHandler(e) {
if (e.column.colId === 'col1') {
// Handle specific cell
} else {
// Handle all other cells, similar to rowClicked
}
}