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
3.99k stars 288 forks source link

Support multiple levels of column groups #837

Open lukasmasuch opened 9 months ago

lukasmasuch commented 9 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 9 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 9 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 9 months ago

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