Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add n_clicks to cellClicked #19

Merged
merged 3 commits into from
Feb 3, 2023
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source D
- Fix issue where columns would not take edits or adjustments due to becoming static

- [#6](https://github.com/plotly/dash-ag-grid/pull/6) Fix props issue for `enableAddRows`
- [#19](https://github.com/plotly/dash-ag-grid/pull/19) Fixed `cellClicked` as reported in [#17](https://github.com/plotly/dash-ag-grid/issues/17)

## [1.3.2] - 2023-01-13

Expand Down
6 changes: 3 additions & 3 deletions src/lib/fragments/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default class DashAgGrid extends Component {
openGroups: new Set(),
filterModel: {},
dangerously_allow_html: JSON.parse(JSON.stringify(this.props.dangerously_allow_html)),

};

if (this.props.rowData) {
Expand Down Expand Up @@ -358,7 +357,8 @@ export default class DashAgGrid extends Component {
}

onCellClicked({value, column: {colId}, rowIndex}) {
this.props.setProps({cellClicked: {value, colId, rowIndex}});
const timestamp = Date.now()
this.props.setProps({cellClicked: {value, colId, rowIndex, timestamp}});
}

onCellValueChanged({oldValue, newValue, column: {colId}, rowIndex}) {
Expand Down Expand Up @@ -566,7 +566,7 @@ export default class DashAgGrid extends Component {
}

this.setUpCols(cellStyle)

let newRowStyle;
if (getRowStyle) {
newRowStyle = (params) => this.handleDynamicRowStyle({params, getRowStyle})
Expand Down