OutTabulatorView icon indicating copy to clipboard operation
OutTabulatorView copied to clipboard

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

Open ViperTG opened this issue 7 years ago • 9 comments

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

ViperTG avatar Jan 28 '19 00:01 ViperTG

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

dfinke avatar Jan 28 '19 21:01 dfinke

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.

ViperTG avatar Jan 29 '19 00:01 ViperTG

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

dfinke avatar Jan 29 '19 00:01 dfinke

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.

ViperTG avatar Jan 29 '19 00:01 ViperTG

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

dfinke avatar Jan 29 '19 01:01 dfinke

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.

ViperTG avatar Jan 29 '19 22:01 ViperTG

Interesting. Maybe ShowFullTable

dfinke avatar Jan 29 '19 22:01 dfinke

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

ViperTG avatar Jan 29 '19 23:01 ViperTG

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

dfinke avatar Jan 29 '19 23:01 dfinke