Skip to content
Source
Sign inSign up
TanStack/table

Column Pivoting #2

Closedtannerlinsley opened this issue 2 comments
tannerlinsleycommented

Similar to #1, Pivoting on columns would be fairly straight forward to implement after #1 is finished. It might even make sense to develop both at the same time. Let's further discuss the requirements for this feature here.

  1. tannerlinsley added labelsfeature

  2. Looking at this now, I think defining the columns should still take precedent here. This would involve doing a lot of automagical data organization with minimal configuration, which at the moment doesn't seems to be the same process for everyone.

    If anyone is interested in pivoting rows into columns, I would suggest performing a simple lodash groupBy + aggregation for each pivotGroup and building columns manually.

    Closing for now.

  3. tannerlinsley closed this

  4. jchenjc(GitHub profile, opens in a new tab)commented

    Hi @tannerlinsley,

    I'm trying to do row pivoting (expand when clicking on the row groups), and also column pivoting (expand when clicking on column groups); so that I can perform rollup operations on both rows and columns with the data. Since column pivoting is not supported now, I tried doing nested column header groups; but looks like that's also not supported, I can have only 2 levels of column. For example, this doesn't work: const columns = [{ header: 'Favorites', headerClassName: 'my-favorites-column-header-group' columns: [{ header: 'Color', columns: [{ header: 'Red', accessor: 'blah.red' }, { header: 'Blue', accessor: 'blah.blue' }] }, ...]

    Now I don't know what else I can try, do you have any suggestion? Thank you!

Sign in to join this conversation.