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

For List-based table types, support header/footer outside scrolling region #48

Open
reedes opened this issue May 7, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@reedes
Copy link
Contributor

reedes commented May 7, 2022

...so the header and/or footer can be independent of the scrolling of the rows. Currently they are inside the scrolling region for these table types, because otherwise there are issues with alignment in the layout.

Header/footer should be independently configurable. See the commented code for Stack- and Grid-based tables. Move the config to the TablerConfig base class so it can be shared by all the table types.

Any conditional views (bounded by if blocks) need to be tested and analyzed to ensure they don't affect scalability.

@reedes reedes added the enhancement New feature or request label May 7, 2022
@JackOSheaDev
Copy link

Hello, was this ever implemented into the library ?

@reedes
Copy link
Contributor Author

reedes commented Dec 7, 2023

Nothing that I've done.

IIRC it was tricky getting the margin right in the header/footer, so I gave up.

There might have been changes to SwiftUI since that have made it possible, but that'll require someone else to pursue and submit a pull request.

@JackOSheaDev
Copy link

Nothing that I've done.

IIRC it was tricky getting the margin right in the header/footer, so I gave up.

There might have been changes to SwiftUI since that have made it possible, but that'll require someone else to pursue and submit a pull request.

Thank you for the quick response, I'm currently doing a project for college using the library so I was wondering if it was possible, I might try to attempt making the header fixed or calculate the number of rows that can be shown on screen and use pagination instead of scrolling.

@reedes
Copy link
Contributor Author

reedes commented Dec 8, 2023

You can try forking the library and modify BaseList (or the selection variants) to place the header and footer builders outside the List block.

See how it's done on BaseGrid and BaseStack. A VStack wrapper may be necessary.

Then use padding as necessary to get things to align. Not ideal, but may be easier than paging!

@JackOSheaDev
Copy link

I'll give that a try thank you !
It also seems like TablerStack works for my use case, but the header styling is slightly different using the default settings.

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

No branches or pull requests

2 participants