New-UDGridLayout Texbox/Switch position strange

No my friend like this:-

Import-Module -Name UniversalDashboard.Community
Get-UDDashboard | Stop-UDDashboard

$global:mypage = New-UDPage -Name "Test" -Endpoint {
    $Layout = '{"lg":[{"w":2,"h":4,"x":0,"y":0,"i":"grid-element-element1","moved":false,"static":true},{"w":3,"h":4,"x":2,"y":0,"i":"grid-element-element2","moved":false,"static":true},{"w":2,"h":3,"x":5,"y":0,"i":"grid-element-element3","moved":false,"static":true},{"w":2,"h":3,"x":7,"y":0,"i":"grid-element-element4","moved":false,"static":true},{"w":2,"h":3,"x":9,"y":0,"i":"grid-element-element5","moved":false,"static":true}]}'

    New-UDGridLayout -Layout $Layout -Content {

        # Position is okay ...

        New-UDCard -Id 'element1' -Endpoint {
            New-UDSelect -Option {
                New-UDSelectOption -Name "bla1" -Value "myvalue1"
                New-UDSelectOption -Name "bla2" -Value "myvalue2"
                New-UDSelectOption -Name "bla3" -Value "myvalue3"
            }
        }
        New-UDCard -Id 'element2' -Endpoint {
            # Position is strange ...
            New-UDTextbox -Label 'put text here ...'
        }
        # Position is okay ...
        New-UDCard -Id 'element3' -Endpoint {
            New-UDButton -Text 'click me ...'
        }

        # Position is okay ...
        New-UDCard -Id 'element4' -Endpoint {
            New-UDCheckbox -Label 'check me ...'
        }

        # Position is strange ...
        New-UDCard -Id 'element5' -Endpoint {
            New-UDSwitch
        }

    } -Draggable -Resizable

}

$Dashboard = New-UDDashboard -Title "Multiselect" -Page $global:mypage
Start-UDDashboard -Dashboard $Dashboard -Port 8002 -Force -Design

On my laptop this shows me


Obviously you could design it going down the page…but this is how I would sort the ‘funky’ automatic display. I hope this helps. Peace

You could go crazy and look at customizing the theme for a different look same script content:-

1 Like