Skip to content

Commit

Permalink
adding dash_clientside to available functions in the grid by default
Browse files Browse the repository at this point in the history
  • Loading branch information
BSd3v committed Oct 3, 2024
1 parent a22ca0e commit 043dbc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source D
- to maintain scroll position during a grid rerender, be sure to use `getRowId`
- fixing side issue where `cellDoubleClicked` was forcing the grid to rerender

### Added
- [#330](https://github.com/plotly/dash-ag-grid/pull/330) Added `dash_clientside` to available functions for easier on-liner functions, esp. `eventListeners`.
- requested [#303](https://github.com/plotly/dash-ag-grid/issues/303)


## [31.2.0] - 2024-02-25

Expand Down
4 changes: 4 additions & 0 deletions src/lib/fragments/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const xssMessage = (context) => {

const NO_CONVERT_PROPS = [...PASSTHRU_PROPS, ...PROPS_NOT_FOR_AG_GRID];

const dash_clientside = window.dash_clientside || {}

const agGridRefs = {};

apiGetters.getApi = (id) => agGridRefs[stringifyId(id)]?.api;
Expand Down Expand Up @@ -1073,6 +1075,7 @@ export default class DashAgGrid extends Component {
const parsedCondition = esprima.parse(funcString).body[0].expression;
const context = {
d3,
dash_clientside,
...customFunctions,
...window.dashAgGridFunctions,
};
Expand All @@ -1083,6 +1086,7 @@ export default class DashAgGrid extends Component {
const parsedCondition = esprima.parse(funcString).body[0].expression;
const context = {
d3,
dash_clientside,
...customFunctions,
...window.dashAgGridFunctions,
setGridProps: this.props.setProps,
Expand Down

0 comments on commit 043dbc8

Please sign in to comment.