Skip to content
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 .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Production Build
BUILD_GRID_VERSION=35.1.0-beta.20260316.108
BUILD_CHARTS_VERSION=13.1.0-beta.20260316
BUILD_GRID_VERSION=35.1.0-beta.20260317.135
BUILD_CHARTS_VERSION=13.1.0-beta.20260317
ENV=local
NX_BATCH_MODE=true
NX_ADD_PLUGINS=false
Expand Down
2 changes: 1 addition & 1 deletion community-modules/locale/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ag-grid-community/locale",
"version": "35.1.0-beta.20260316.108",
"version": "35.1.0-beta.20260317.135",
"description": "Localisation Module for AG Grid, providing translations in 31 languages.",
"main": "./dist/package/main.cjs.js",
"types": "./dist/types/src/main.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion community-modules/styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ag-grid-community/styles",
"version": "35.1.0-beta.20260316.108",
"version": "35.1.0-beta.20260317.135",
"description": "AG Grid Styles and Themes",
"main": "_index.scss",
"files": [
Expand Down
24 changes: 12 additions & 12 deletions documentation/ag-grid-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ag-grid-docs",
"description": "Documentation for AG Grid",
"type": "module",
"version": "35.1.0-beta.20260316.108",
"version": "35.1.0-beta.20260317.135",
"repository": {
"type": "git",
"url": "https://github.com/ag-grid/ag-grid.git"
Expand Down Expand Up @@ -53,17 +53,17 @@
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@pqina/flip": "^1.8.4",
"ag-charts-angular": "13.1.0-beta.20260316",
"ag-charts-community": "13.1.0-beta.20260316",
"ag-charts-enterprise": "13.1.0-beta.20260316",
"ag-charts-types": "13.1.0-beta.20260316",
"ag-charts-react": "13.1.0-beta.20260316",
"ag-charts-vue3": "13.1.0-beta.20260316",
"ag-grid-angular": "35.1.0-beta.20260316.108",
"ag-grid-community": "35.1.0-beta.20260316.108",
"ag-grid-enterprise": "35.1.0-beta.20260316.108",
"ag-grid-react": "35.1.0-beta.20260316.108",
"ag-grid-vue3": "35.1.0-beta.20260316.108",
"ag-charts-angular": "13.1.0-beta.20260317",
"ag-charts-community": "13.1.0-beta.20260317",
"ag-charts-enterprise": "13.1.0-beta.20260317",
"ag-charts-types": "13.1.0-beta.20260317",
"ag-charts-react": "13.1.0-beta.20260317",
"ag-charts-vue3": "13.1.0-beta.20260317",
"ag-grid-angular": "35.1.0-beta.20260317.135",
"ag-grid-community": "35.1.0-beta.20260317.135",
"ag-grid-enterprise": "35.1.0-beta.20260317.135",
"ag-grid-react": "35.1.0-beta.20260317.135",
"ag-grid-vue3": "35.1.0-beta.20260317.135",
"algoliasearch": "^4.18.0",
"astro": "5.16.6",
"cheerio": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,24 @@
"displayName": "Row Expand and Collapse",
"description": "See [Row Grouping](./grouping-opening-groups/), [Master Detail](./master-detail/) or [Tree Data](./tree-data-opening-groups/) for more information"
},
"expandAll": {},
"collapseAll": {},
"expandAll": {
"more": {
"name": "Expanding Groups",
"url": "./grouping-opening-groups/#api"
}
},
"collapseAll": {
"more": {
"name": "Expanding Groups",
"url": "./grouping-opening-groups/#api"
}
},
"resetRowGroupExpansion": {
"more": {
"name": "Reset Group Expansion",
"url": "./grouping-opening-groups/#reset-group-expansion"
}
},
"setRowNodeExpanded": {
"more": {
"name": "Expand to a Row",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1731,8 +1731,18 @@
"url": "./server-side-model-pivoting/#supplying-pivot-result-fields-simple"
}
},
"serverSideSortAllLevels": {},
"serverSideEnableClientSideSort": {},
"serverSideSortAllLevels": {
"more": {
"name": "Sorting All Levels",
"url": "./server-side-model-sorting/#sorting-all-levels"
}
},
"serverSideEnableClientSideSort": {
"more": {
"name": "Client-side Sorting",
"url": "./server-side-model-sorting/#client-side-sorting"
}
},
"serverSideOnlyRefreshFilteredGroups": {
"more": {
"name": "Filters",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { expect, test } from '@utils/grid/test-utils';

test.agExample(import.meta, () => {
test.eachFramework('Example', async ({ page, agIdFor }) => {
const australiaId = 'row-group-country-Australia';
const australia2004Id = 'row-group-country-Australia-year-2004';
const unitedStatesId = 'row-group-country-United States';

// Initial state: isGroupOpenByDefault expands Australia > 2004
await expect(agIdFor.autoGroupExpanded(australiaId)).toBeVisible();
await expect(agIdFor.autoGroupExpanded(australia2004Id)).toBeVisible();
await expect(agIdFor.autoGroupContracted(unitedStatesId)).toBeVisible();

// Expand All — United States should now be expanded
await page.getByRole('button', { name: 'Expand All' }).click();
await expect(agIdFor.autoGroupExpanded(unitedStatesId)).toBeVisible();

// Reset to Defaults — back to isGroupOpenByDefault state
await page.getByRole('button', { name: 'Reset to Defaults' }).click();
await expect(agIdFor.autoGroupExpanded(australiaId)).toBeVisible();
await expect(agIdFor.autoGroupExpanded(australia2004Id)).toBeVisible();
await expect(agIdFor.autoGroupContracted(unitedStatesId)).toBeVisible();

// Collapse All — everything collapsed
await page.getByRole('button', { name: 'Collapse All' }).click();
await expect(agIdFor.autoGroupContracted(australiaId)).toBeVisible();

// Reset to Defaults — Australia > 2004 expanded again
await page.getByRole('button', { name: 'Reset to Defaults' }).click();
await expect(agIdFor.autoGroupExpanded(australiaId)).toBeVisible();
await expect(agIdFor.autoGroupExpanded(australia2004Id)).toBeVisible();
await expect(agIdFor.autoGroupContracted(unitedStatesId)).toBeVisible();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="example-wrapper">
<div style="margin-bottom: 5px">
<button onClick="onBtExpandAll()">Expand All</button>
<button onClick="onBtCollapseAll()">Collapse All</button>
<button onClick="onBtResetExpansion()">Reset to Defaults</button>
</div>
<div id="myGrid"></div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import type { GridApi, GridOptions, IsGroupOpenByDefaultParams } from 'ag-grid-community';
import {
ClientSideRowModelApiModule,
ClientSideRowModelModule,
ModuleRegistry,
RowApiModule,
ValidationModule,
createGrid,
} from 'ag-grid-community';
import { RowGroupingModule } from 'ag-grid-enterprise';

ModuleRegistry.registerModules([
RowApiModule,
ClientSideRowModelModule,
ClientSideRowModelApiModule,
RowGroupingModule,
...(process.env.NODE_ENV !== 'production' ? [ValidationModule] : []),
]);

let gridApi: GridApi<IOlympicData>;

const gridOptions: GridOptions<IOlympicData> = {
columnDefs: [
{ field: 'country', rowGroup: true },
{ field: 'year', rowGroup: true },
{ field: 'sport' },
{ field: 'athlete' },
{ field: 'total' },
],
defaultColDef: {
flex: 1,
minWidth: 100,
},
autoGroupColumnDef: {
minWidth: 200,
},
isGroupOpenByDefault: (params: IsGroupOpenByDefaultParams) => {
const route = params.rowNode.getRoute();
const destPath = ['Australia', '2004'];
return !!route?.every((item, idx) => destPath[idx] === item);
},
};

function onBtExpandAll() {
gridApi!.expandAll();
}

function onBtCollapseAll() {
gridApi!.collapseAll();
}

function onBtResetExpansion() {
gridApi!.resetRowGroupExpansion();
}

// setup the grid after the page has finished loading
document.addEventListener('DOMContentLoaded', function () {
const gridDiv = document.querySelector<HTMLElement>('#myGrid')!;
gridApi = createGrid(gridDiv, gridOptions);

fetch('https://www.ag-grid.com/example-assets/olympic-winners.json')
.then((response) => response.json())
.then((data: IOlympicData[]) => gridApi!.setGridOption('rowData', data));
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.example-wrapper {
display: flex;
flex-direction: column;
height: 100%;
}

#myGrid {
flex: 1 1 0px;
width: 100%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The row group expansion state can be saved and restored as part of [Grid State](
{% /note %}

The grid exposes API methods to expand or collapse groups programmatically.
{% apiDocumentation source="grid-api/api.json" section="rowExpansion" names=["setRowNodeExpanded", "expandAll", "collapseAll"] /%}
{% apiDocumentation source="grid-api/api.json" section="rowExpansion" names=["setRowNodeExpanded", "expandAll", "collapseAll", "resetRowGroupExpansion"] /%}

### Expand Row Ancestors

Expand All @@ -93,3 +93,11 @@ const expandToRow = () => {
}
}
```

### Reset Group Expansion

After users have expanded or collapsed groups, `resetRowGroupExpansion()` discards all overrides and re-evaluates each group against the configured defaults (`groupDefaultExpanded` or `isGroupOpenByDefault`).

In the example below, the `isGroupOpenByDefault` callback expands the `Australia > 2004` path by default. Try expanding or collapsing groups, then click **Reset to Defaults** to restore the original expansion state.

{% gridExampleRunner title="Reset Group Expansion" name="reset-group-expansion" /%}
2 changes: 1 addition & 1 deletion documentation/update-algolia-indices/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "update-algolia-indices",
"version": "35.1.0-beta.20260316.108",
"version": "35.1.0-beta.20260317.135",
"description": "Update algolia indices",
"main": "src/index.ts",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ag-grid",
"version": "35.1.0-beta.20260316.108",
"version": "35.1.0-beta.20260317.135",
"license": "MIT",
"scripts": {
"compressVideo": "tsx external/ag-website-shared/scripts/compress-video",
Expand Down
6 changes: 3 additions & 3 deletions packages/ag-grid-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ag-grid-angular",
"version": "35.1.0-beta.20260316.108",
"version": "35.1.0-beta.20260317.135",
"description": "AG Grid Angular Component",
"scripts": {
"clean": "rimraf dist",
Expand All @@ -15,7 +15,7 @@
"module": "./dist/ag-grid-angular/fesm2022/ag-grid-angular.mjs",
"typings": "./dist/ag-grid-angular/index.d.ts",
"dependencies": {
"ag-grid-community": "35.1.0-beta.20260316.108",
"ag-grid-community": "35.1.0-beta.20260317.135",
"@angular/animations": "^18.0.7",
"@angular/common": "^18.0.7",
"@angular/compiler": "^18.0.7",
Expand All @@ -27,7 +27,7 @@
"zone.js": "~0.15.1"
},
"devDependencies": {
"ag-grid-community": "35.1.0-beta.20260316.108",
"ag-grid-community": "35.1.0-beta.20260317.135",
"@angular-devkit/build-angular": "^18.0.7",
"@angular/cli": "^18.0.7",
"@angular/forms": "^18.0.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "ag-grid-angular",
"version": "35.1.0-beta.20260316.108",
"version": "35.1.0-beta.20260317.135",
"description": "AG Grid Angular Component",
"license": "MIT",
"peerDependencies": {
"@angular/common": ">= 18.0.0",
"@angular/core": ">= 18.0.0"
},
"dependencies": {
"ag-grid-community": "35.1.0-beta.20260316.108",
"ag-grid-community": "35.1.0-beta.20260317.135",
"tslib": "^2.3.0"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ag-grid-community/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ag-grid-community",
"version": "35.1.0-beta.20260316.108",
"version": "35.1.0-beta.20260317.135",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
"main": "./dist/package/main.cjs.js",
"types": "./dist/types/src/main.d.ts",
Expand Down Expand Up @@ -119,7 +119,7 @@
],
"homepage": "https://www.ag-grid.com/",
"dependencies": {
"ag-charts-types": "13.1.0-beta.20260316"
"ag-charts-types": "13.1.0-beta.20260317"
},
"devDependencies": {
"web-streams-polyfill": "^3.3.2",
Expand Down
11 changes: 10 additions & 1 deletion packages/ag-grid-community/src/api/gridApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,15 @@ export interface _CsrmSsrmSharedGridApi {
* @agModule `ClientSideRowModelApiModule / ServerSideRowModelApiModule`
*/
collapseAll(): void;

/**
* Reset all group expansion to defaults, as determined by `groupDefaultExpanded`,
* `isGroupOpenByDefault`, or `isServerSideGroupOpenByDefault`.
* Any user-initiated expand/collapse overrides are discarded.
*
* @agModule `ClientSideRowModelApiModule / ServerSideRowModelApiModule`
*/
resetRowGroupExpansion(): void;
}

export interface _RowModelSharedApi {
Expand Down Expand Up @@ -631,7 +640,7 @@ export interface _ColumnResizeApi {
}

export interface _ColumnMoveApi {
/** Moves the column at `fromIdex` to `toIndex`. The column is first removed, then added at the `toIndex` location, thus index locations will change to the right of the column after the removal. */
/** Moves the column at `fromIndex` to `toIndex`. The column is first removed, then added at the `toIndex` location, thus index locations will change to the right of the column after the removal. */
moveColumnByIndex(fromIndex: number, toIndex: number): void;

/** Moves columns to `toIndex`. The columns are first removed, then added at the `toIndex` location, thus index locations will change to the right of the column after the removal. */
Expand Down
1 change: 1 addition & 0 deletions packages/ag-grid-community/src/api/gridApiFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export const gridApiFunctionsMap: Record<keyof GridApi, ValidationModuleName> =
...mod<_CsrmSsrmSharedGridApi>('CsrmSsrmSharedApi', {
expandAll: 0,
collapseAll: 0,
resetRowGroupExpansion: 0,
}),
...mod<_SsrmInfiniteSharedGridApi>('SsrmInfiniteSharedApi', {
setRowCount: 0,
Expand Down
4 changes: 4 additions & 0 deletions packages/ag-grid-community/src/api/rowModelSharedApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ export function resetRowHeights(beans: BeanCollection) {
}
beans.rowModel?.resetRowHeights();
}

export function resetRowGroupExpansion(beans: BeanCollection) {
beans.expansionSvc?.resetExpansion();
}
10 changes: 8 additions & 2 deletions packages/ag-grid-community/src/api/sharedApiModule.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import type { _ModuleWithApi } from '../interfaces/iModule';
import { VERSION } from '../version';
import type { _CsrmSsrmSharedGridApi, _RowModelSharedApi, _SsrmInfiniteSharedGridApi } from './gridApi';
import { collapseAll, expandAll, onRowHeightChanged, resetRowHeights } from './rowModelSharedApi';
import {
collapseAll,
expandAll,
onRowHeightChanged,
resetRowGroupExpansion,
resetRowHeights,
} from './rowModelSharedApi';
import { getCacheBlockState, isLastRowIndexKnown, setRowCount } from './ssrmInfiniteSharedApi';

// these modules are not used in core, but are shared between multiple other modules
Expand All @@ -12,7 +18,7 @@ import { getCacheBlockState, isLastRowIndexKnown, setRowCount } from './ssrmInfi
export const CsrmSsrmSharedApiModule: _ModuleWithApi<_CsrmSsrmSharedGridApi> = {
moduleName: 'CsrmSsrmSharedApi',
version: VERSION,
apiFunctions: { expandAll, collapseAll },
apiFunctions: { expandAll, collapseAll, resetRowGroupExpansion },
};

/**
Expand Down
Loading
Loading