- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.2k
Add column groups #3287
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
Add column groups #3287
Conversation
        
          
                src/GroupedColumnHeaderCell.tsx
              
                Outdated
          
        
      | const index = column.idx + 1; | ||
|  | ||
| function onClick() { | ||
| selectCell(column.idx); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to update cell selection logic to handle rowSpan also
| Codecov Report
 @@            Coverage Diff             @@
##             main    #3287      +/-   ##
==========================================
- Coverage   83.75%   83.13%   -0.63%     
==========================================
  Files          45       47       +2     
  Lines        4568     4827     +259     
  Branches      717      752      +35     
==========================================
+ Hits         3826     4013     +187     
- Misses        742      814      +72     
 | 
…ata-grid into am-column-groups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. I will run a few more tests and approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few final comments
        
          
                src/GroupedColumnHeaderRow.tsx
              
                Outdated
          
        
      | className={clsx(headerRowClassname, { | ||
| [rowSelectedClassname]: selectedCellIdx === -1 | ||
| })} | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| className={clsx(headerRowClassname, { | |
| [rowSelectedClassname]: selectedCellIdx === -1 | |
| })} | |
| className={headerRowClassname} | 
TreeDataGrid is not supported so may be we can remove it
| return { '--rdg-grid-row-start': rowIdx } as unknown as CSSProperties; | ||
| } | ||
|  | ||
| export function getHeaderCellStyle<R, SR>( | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth updating this function to handle colSpan also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCellStyle handles it already, so it'd duplicate the work for normal header cells 🤔
| } | ||
| ]; | ||
|  | ||
| test('grouping', () => { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also test that clicking on the group cell correctly selects it. We can do this when we fix cell navigation
* Initial commit to support column groups * idk * calculated groups * progress * progress * progress * remove level, fix header rows count * row span * fix incorrectly skipped headers * fix scrollPaddingBlock * Add `aria-rowspan` * add padding on top to move content at the bottom * fix colSpan * fix aria-rowspan * render grouped column header cells without duplicates * fix cell positions * remove `children` * disallow col groups in TreeDataGrid * fix test * add grouping test * tweak * dedupe headerRowsHeight * Remove TODO * Fix cell click selection on the column group * grouping -> row grouping * add col grouping page * revert common features * simplify getHeaderCellStyle * Fix params * add headerCellClass on ColumnGroup * group the Or types * remove TODO, add summary rows in the example * export CalculatedColumnParent and CalculatedColumnOrColumnGroup * minor tweaks * Combine `useMoreCalculatedColumnsStuff` and `useCalculatedColumns` * tweaks * consistent gridColumnEnd * fix tests * rm rowSelectedClassname usage * fix cell borders --------- Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com> Co-authored-by: Nicolas Stepien <stepien.nicolas@gmail.com>

No description provided.