Skip to content
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

Expandable columns #386

Open
mauritzvdworm opened this issue Jul 29, 2024 · 2 comments
Open

Expandable columns #386

mauritzvdworm opened this issue Jul 29, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mauritzvdworm
Copy link

Excel has a group feature that you can apply over columns. Below is a simple example:

image

Clicking the + gives

image

I want to recreate this with reactable, but the only way I can manage is to transpose the data. I'd like to be able to expand the columns like you can with the rows. There is already the ability to group by columns, would it be possible to add this functionality?

@glin glin added the enhancement New feature or request label Aug 5, 2024
@glin
Copy link
Owner

glin commented Aug 5, 2024

Technically it would be possible, but there'd be a bunch of questions to work out first since reactable isn't set up this way like Excel is. For example, where would you put the controls to expand columns - inside or outside the table? Either way, it would be introducing a new type of element to the table layout, with things to figure out like styling, positioning, making the control keyboard accessible, etc.

For now though, I think you could possibly implement a version of column expansion yourself using the JavaScript API, and the methods to toggle column visibility. For example, the Column Visibility Toggle Button example. So you start out with all your columns in the table, with the collapsed columns hidden initially. Then you can place a button somewhere outside or inside the table that toggles those hidden columns visible using Reactable.setHiddenColumns().

I think this would work with multiple sets of expandable columns too.

@mauritzvdworm
Copy link
Author

Thanks for the feedback, I'll see if I can jerry-rig something together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants