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

Set height of table to 98% of viewport size (98vh) #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ViperTG
Copy link
Contributor

@ViperTG ViperTG commented Jan 28, 2019

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.

outtabulatorview-hscrollbarfix

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

@dfinke
Copy link
Owner

dfinke commented Jan 28, 2019

Thinking of adding an -AutoFit switch? If specified, then set the value. Thoughts?

@ViperTG
Copy link
Contributor Author

ViperTG commented Jan 29, 2019

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.

@dfinke
Copy link
Owner

dfinke commented Jan 29, 2019

Good point. Just curious, if it's recommended by the framework, why don't they enable it by default? ;-)

@ViperTG
Copy link
Contributor Author

ViperTG commented Jan 29, 2019

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.

@dfinke
Copy link
Owner

dfinke commented Jan 29, 2019

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, DoNotLimitToViewPort

@ViperTG
Copy link
Contributor Author

ViperTG commented Jan 29, 2019

Other options could be:

NoTableHeight
NoTableLimit
DoNotSetTableHight
NoHeight

Leaning most towards something like NoTableHeight as the ViewPort is something in HTML that maybe not a lot will know what is and table is maybe more intuitive.

@dfinke
Copy link
Owner

dfinke commented Jan 29, 2019

Interesting. Maybe ShowFullTable

@ViperTG
Copy link
Contributor Author

ViperTG commented Jan 29, 2019

Would that not imply that we are hiding stuff by default which is not the case here.

@dfinke
Copy link
Owner

dfinke commented Jan 29, 2019

Yeah. Maybe a param name like on Format-Table something along -AutoSize ?

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

Successfully merging this pull request may close these issues.

2 participants