Prerequisites
- A working sheet configuration with multiple columns defined
- Familiarity with column groups
Step 1: Define Column Groups with Collapse Targets
In your sheet configuration YAML, add acolumnGroups section. For each group that should be collapsible, specify the collapseTo property pointing to the column that remains visible when the group is collapsed.
collapseTo value must be a valid binding path of a column that belongs to the same group.
Step 2: Assign Columns to Groups
Each column that should participate in a collapsible group needs acolumnGroup property matching the group key:
systemRequirements.systemRequirement.title column remains visible because it matches the collapseTo path.
Step 3: Understand the Collapse Behavior
collapseTo is configured. Clicking the button hides all columns in the group except the designated collapse target column. Clicking the toggle again expands the group back to its full column set.
If a column group does not define
collapseTo, no collapse toggle button appears in the group header. The group still provides visual organization but cannot be collapsed.Step 4: Handle Columns Without a Group
Columns that are not assigned to anycolumnGroup still display correctly. They appear with a blank group header cell, maintaining the consistent two-row header structure across the entire sheet.
Step 5: Combine with Row Grouping
Collapsible column groups work independently from row grouping. You can combine both features:- Column groups collapse columns horizontally (hiding detail columns)
- Row grouping collapses rows vertically (using
groupByon a column or keyboard shortcutsCtrl+G/Ctrl+Shift+G)
Verification
After saving the configuration and reloading the powersheet document:- You should now see group headers spanning multiple columns with the group name displayed
- Groups with
collapseTodefined should show a toggle button in the group header - Clicking the toggle should hide all columns except the collapse target
- Clicking again should restore all columns in the group
See Also
- Configure a Column Group — set up basic column grouping with styling
- Add a Column — add individual columns to your sheet configuration
- Configure Column Width — control column sizing
- Create a View — create named views with different column visibility presets
Sources
Sources
Source Code
prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/sheet/commands/group-row.tsprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/cypress/e2e/Sheet/master-downstream.spec.tsprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/sheet/ViewModel.tsprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/cypress/e2e/Sheet/column-groups.spec.tsprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/sheet/SheetComponent.tsx