Hi,
I am executing the following code:
Data = @(
[PSCustomObject]@{Animal="Frog";Order="Anura"}
[PSCustomObject]@{Animal="Tiger";Order="Carnivora"}
[PSCustomObject]@{Animal="Bat";Order="Chiroptera"}
[PSCustomObject]@{Animal="Fox";Order="Carnivora"}
)
$Dashboard = New-UDDashboard -Title "Grids - Simple" -Content {
New-UDGrid -Title "Animals" -Headers @("Animal", "Order") -Properties @("Animal", "Order") -Endpoint {
Data | Out-UDGridData
}
}
Start-UDDashboard -Dashboard $Dashboard -Port 8080
When I am trying to open URL, it kind of trying to load something, but nothing happens.
Within the development console, I see the following error:
Hi @shykhovtsov is this all of your code? Just if it is you have not imported the module. You ok to upload all your code if this isn’t all your code. Thanks
Hi,
Sorry, here is my full code(the module was already imported):
Import-Module UniversalDashboard.Community
Import-Module UniversalDashboard.Community
$Data = @(
[PSCustomObject]@{Animal=“Frog”;Order=“Anura”}
[PSCustomObject]@{Animal=“Tiger”;Order=“Carnivora”}
[PSCustomObject]@{Animal=“Bat”;Order=“Chiroptera”}
[PSCustomObject]@{Animal=“Fox”;Order=“Carnivora”}
)
$Dashboard = New-UDDashboard -Title “Grids - Simple” -Content {
New-UDGrid -Title “Animals” -Headers @(“Animal”, “Order”) -Properties @(“Animal”, “Order”) -Endpoint {
$Data | Out-UDGridData
}
}
Start-UDDashboard -Dashboard $Dashboard -Port 8080
Thank you for help.
Hi @shykhovtsov thanks for providing your code, I have got a working version doing the following:-
Import-Module UniversalDashboard.Community
Get-UDDashboard | Stop-UDDashboard
$LandingPage = New-UDPage -Name “Grids” -Icon bar_chart -Content {
New-UDGrid -Title “Animals” -Headers @(“Animal”, “Order”) -Properties @(“Animal”, “Order”) -Endpoint {
$Data = @(
[PSCustomObject]@{Animal = "Frog”; Order = "Anura” }
[PSCustomObject]@{Animal = "Tiger”; Order = "Carnivora” }
[PSCustomObject]@{Animal = "Bat”; Order = "Chiroptera” }
[PSCustomObject]@{Animal = "Fox”; Order = "Carnivora” }
)
$Data | Out-UDGridData
}
}
$Dashboard = New-UDDashboard -Title “Grid Test” -Pages @(
$LandingPage
)
Start-UDDashboard -Dashboard $Dashboard -Port 8080