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

Added property setIsGrouping #1471

Merged
merged 1 commit into from
Sep 5, 2024
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.3",
"version": "17.0.4",
"license": "MIT",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -144,4 +144,4 @@
"*.{ts,tsx}": "eslint --cache --fix",
"*.{ts,tsx,js,css,md}": "prettier --write"
}
}
}
7 changes: 7 additions & 0 deletions src/components/data-grid/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const DataGrid = ({
setFiltersHeight,
defaultDateQuickSelect = QuickSelectDateOption.THIS_YEAR,
exportFileName,
setIsGrouping,
}: DataGridProps) => {
const [gridApi, setGridApi] = useState<GridApi>(new GridApi());
const [gridColumns, setGridColumns] = useState<DataGridColumn[]>(columns || []);
Expand Down Expand Up @@ -805,6 +806,12 @@ export const DataGrid = ({
};
}, [hasFooterRowCount, showPagination, paginationPageSize]);

useEffect(() => {
if (setIsGrouping) {
setIsGrouping(!!selectedGroupOption);
}
}, [setIsGrouping, selectedGroupOption]);

return (
<>
<Filters
Expand Down
1 change: 1 addition & 0 deletions src/components/data-grid/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ export interface DataGridProps {
hasStoredFilters?: boolean;
defaultDateQuickSelect?: QuickSelectDateOption;
exportFileName?: string;
setIsGrouping?: (isGrouping: boolean) => void;
}

export interface DataGridView {
Expand Down
Loading