-
Notifications
You must be signed in to change notification settings - Fork 6
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
Set height of table to 98% of viewport size (98vh) #14
base: master
Are you sure you want to change the base?
Conversation
Thinking of adding an |
I'm thinking more it should be default and then have the option to disable the height setting, seeing as it increases rendering performance and is recommended by Tabulator framework. |
Good point. Just curious, if it's recommended by the framework, why don't they enable it by default? ;-) |
I don't know I'm guessing it's because it is a JS framework and they let settings like the height and width up to the implementer since they decide where to place it. The use case here is special in that normally if you used this on a webpage you design you would not place a to contain a table that goes beyond the users viewport. So I think it is just a web developer thing :)
But have a look at the FAQ under The table takes a long time to load it describes where you can set it and why it should be set. I used the option of setting it in the table constructor, but maybe doing it in the CSS is cleaner. |
Cool. It sounds like a sensible default. Excel has an "AutoFit", you need to specify it explicitly, but it makes more sense there because it could be an operation on thousands of rows compared to a viewport for a page. Need to think of a sensible name to disable it, |
Other options could be:
Leaning most towards something like |
Interesting. Maybe |
Would that not imply that we are hiding stuff by default which is not the case here. |
Yeah. Maybe a param name like on |
This fixes the issue #11 that I had with this module.
By setting the table height for Tabulator then it can maintain the scrollbars in view and also the added benefit of the data rendering faster as it only needs to render the data on screen, not the entire table. In the Tabulator documentation it is recommended to set the height to avoid performance issues.
I have set the height to 98vh meaning 98% of the browser window size, had to go a bit lower as the scrollbar would be just out of view if set to 100.
This is just a quick fix, maybe it should be an option or something, you decide.
Tested on:
PSVersion 6.2.0-preview.3
PSEdition Core
GitCommitId 6.2.0-preview.3
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Browser: Google Chrome 71