glideapps / glide-data-grid

🚀 Glide Data Grid is a no compromise, outrageously react fast data grid with rich rendering, first class accessibility, and full TypeScript support.
https://grid.glideapps.com
MIT License
4.1k stars 302 forks source link

Support multiple levels of column groups #837

Open lukasmasuch opened 11 months ago

lukasmasuch commented 11 months ago

Supporting multiple column group levels would be useful for use cases like pivot tables.

image

Proposed API:

Allow specifying a list of group names that are used to create multi-level column groups:

interface BaseGridColumn {
   ... 
   readonly group?: string | string[];
}
jassmith commented 11 months ago

I see someone has been crawling the ag-grid docs :P

This is relatively straightforward to achieve and requires little more than precomputing the deepest chain, creating a lookup method, and then changing the group headers draw to work more like drawCells

This does make mapping the group header index back into the clicked group a bit hairy for the user. Something to think about.

lukasmasuch commented 11 months ago

yeah, have been looking around for some inspiration :)

But this feature would also resolve one of the more requested issues in Streamlit: https://github.com/streamlit/streamlit/issues/6319

lukasmasuch commented 11 months ago

I just saw that there was already some discussion on this here: https://github.com/glideapps/glide-data-grid/discussions/798