New-UDTable - Sticky Header parameter doesn't work?

Product: PowerShell Universal
Version: 2.10

Hi,

I’m trying to use the -StickyHeader parameter for New-UDTable. It doesn’t seem to do anything even on latest PSU version. Is there any limitations for making this work. Ideally I want the header row of the table to scroll with the table. Let me know. Thanks.

I’m assuming this is a bug so I’ll open an issue for it. It’s a parameter that should just work and doesn’t require any additional configuration.

Thanks Adam.

I did a little reading about MUI table component. I think it specifies you need a scroll bar for StickyHeader to work in MUI. I was able to do that by using New-UDStyle to specify maxheight for MuiTableContainerRoot but StickyHeader still not doing anything in PSU.

Hi Adam,

I saw that you closed out bug saying that -Maxheight needs to be specified. However using -StickyHeader and -MaxHeight didn’t work still.

I was able to by doing the following based on HTML method of doing it:
New-UDStyle -Style ‘.MuiTableHead-root {position:sticky; top: 0; background-color: white}’ -Content {
New-UDTable -Id “sqltable” -PageSize 5000 -MaxHeight 1000 -LoadData {} -Columns @() -Sort -Filter
}

Still have some things to sort out such as buttons displaying over the table header and adapting header background color to the current dashboard theme i.e. dark mode or other colors. But this makes UDTable much more useable. Thanks.

1 Like