Skip to content

Conversation

ryanrozich
Copy link
Owner

Summary

  • Implements full server-side grouping with aggregations in the demo API
  • Enables row grouping features in the ServerSideDemo component
  • This is a demo-only branch - NOT intended for merge (would cause conflicts with release branches)

What's New

This PR adds server-side grouping capabilities to demonstrate how AG Grid can perform grouping and aggregations on the server rather than the client.

Server-Side Changes (api/data-generator.js)

  • Added createGroupRow helper function to create group rows with aggregated values
  • Implemented performGrouping function to handle:
    • Top-level grouping
    • Nested group hierarchies
    • Aggregations (sum, average) for numeric fields
    • Child count metadata
  • Modified processDataRequest to use server-side grouping when rowGroupCols are provided

Client-Side Changes (ServerSideDemo.tsx)

  • Added rowGroupCols and groupKeys parameters to API requests
  • Enabled row grouping panel (rowGroupPanelShow="always")
  • Configured autoGroupColumnDef for proper group display
  • Updated demo banner to highlight server-side grouping capability

How to Test

  1. Visit the deployed demo once this PR is merged
  2. Navigate to the "Server-Side Demo" tab
  3. Drag columns (Status, Priority, Category, Assignee) to the grouping panel
  4. Observe that:
    • Groups show aggregated values (totals, averages)
    • Expanding groups fetches data from the server
    • Aggregations are calculated server-side, not client-side

Aggregations Provided

  • value: Sum of all values in the group
  • amountDelivered: Sum of delivered amounts
  • remaining: Calculated as value - amountDelivered
  • percentDelivered: Average percentage across group
  • estimatedHours: Sum of estimated hours
  • actualHours: Sum of actual hours

Note

This branch is for demonstration purposes only and will remain open for deployment preview. It should NOT be merged into main as it would conflict with existing release branches.

🤖 Generated with Claude Code

Copy link

github-actions bot commented Aug 12, 2025

🚀 Demo Preview Ready!

Preview URL: https://demo.rozich.net/ag-grid-react-components-pr-106/
API URL: https://demo.rozich.net/ag-grid-react-components-pr-106/api/

⚠️ Deployment tests failed - please check the workflow logs

This preview will be available for testing until the PR is merged or closed.

- Add server-side grouping logic with aggregations in data-generator.js
- Create helper functions for group row creation and hierarchical grouping
- Pass rowGroupCols and groupKeys from client to server
- Enable row grouping UI in ServerSideDemo component
- Configure autoGroupColumnDef for proper group display
- Support multi-level grouping with drill-down capabilities

Demo-only branch - not intended for merge
@ryanrozich ryanrozich force-pushed the demo/server-side-grouping branch from 1ea61b6 to 04015c5 Compare August 12, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has-preview status: in-code-review PR ready, awaiting code review

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant