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

bump to AG Grid version 32.2 #328

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
104 changes: 69 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-ag-grid",
"version": "31.2.0",
"version": "32.2.0",
"description": "Dash wrapper around AG Grid, the best interactive data grid for the web.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,9 +32,9 @@
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"ag-grid-community": "31.2.1",
"ag-grid-enterprise": "31.2.1",
"ag-grid-react": "31.2.1",
"ag-grid-community": "32.2.0",
"ag-grid-enterprise": "32.2.0",
"ag-grid-react": "32.2.0",
"@mui/icons-material": "^5.15.7",
"@mui/material": "^5.15.7",
"d3-format": "^3.1.0",
Expand Down
7 changes: 5 additions & 2 deletions src/lib/fragments/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import MarkdownRenderer from '../renderers/markdownRenderer';
import RowMenuRenderer from '../renderers/rowMenuRenderer';
import {customFunctions} from '../renderers/customFunctions';

import {AgGridReact} from 'ag-grid-react';
import {AgGridReact, useGridFilter} from 'ag-grid-react';

import 'ag-grid-community/styles/ag-grid.css';
import 'ag-grid-community/styles/ag-theme-alpine.css';
Expand Down Expand Up @@ -1141,7 +1141,7 @@ export default class DashAgGrid extends Component {
cellRendererData: {
value,
colId: props.column.colId,
rowIndex: props.rowIndex,
rowIndex: props.node.sourceRowIndex,
rowId: props.node.id,
timestamp: Date.now(),
},
Expand Down Expand Up @@ -1465,3 +1465,6 @@ DashAgGrid.propTypes = {parentState: PropTypes.any, ..._propTypes};

export const propTypes = DashAgGrid.propTypes;
export const defaultProps = DashAgGrid.defaultProps;

var dagfuncs = (window.dash_ag_grid = window.dash_ag_grid || {});
dagfuncs.useGridFilter = useGridFilter;
40 changes: 17 additions & 23 deletions tests/assets/dashAgGridFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,29 +184,23 @@ const {useImperativeHandle, useState, useEffect, forwardRef} = React;
dagfuncs.YearFilter = forwardRef((props, ref) => {
const [year, setYear] = useState('All');

useImperativeHandle(ref, () => {
return {
doesFilterPass(params) {
return params.data.year >= 2010;
},

isFilterActive() {
return year === '2010'
},

// this example isn't using getModel() and setModel(),
// so safe to just leave these empty. don't do this in your code!!!
getModel() {
},

setModel() {
}
}
});

useEffect(() => {
props.filterChangedCallback()
}, [year]);
dash_ag_grid.useGridFilter({
doesFilterPass(params) {
return params.data.year >= 2010;
},

// this example isn't using getModel() and setModel(),
// so safe to just leave these empty. don't do this in your code!!!
getModel() {
},

setModel() {
}
});

useEffect(() => {
props.onModelChange(year === "All" ? null : year)
}, [year]);

setProps = ({value}) => {
if (value) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_custom_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_fi003_custom_filter(dash_duo):

grid.wait_for_cell_text(0, 0, "23")

dash_duo.find_element('.ag-header-cell[aria-colindex="3"] .ag-icon-menu').click()
dash_duo.find_element('.ag-header-cell[aria-colindex="3"] span[data-ref="eFilterButton"]').click()

dash_duo.find_element('.ag-filter label:nth-child(2)').click()

Expand Down
Loading