Product: PowerShell Universal
Version: 5.3.0
Hi.
I’ve tried to create a table where it is possible to select multiple columns.
If I tick the “select all” checkbox, I get back all items, but if I select them step by step, I only get back the latest selection (1 item).
What can I do to get all (individual) selected items(to pass them to another script)?
$Cache:SelectedRows = @()
New-UDTable -Title "Example Table" -Columns @(
New-UDTableColumn -Property "Name" -Title "Name"
New-UDTableColumn -Property "Age" -Title "Age"
) -Data @(
@{ Name = "John Doe"; Age = 30 }
@{ Name = "Jane Doe"; Age = 25 }
@{ Name = "Hans Wurst "; Age = 17 }
) -ShowSelection -OnRowSelection {
$Cache:SelectedRows = $EventData
Set-UDElement -Id "lblOutput" -Properties @{
text = ("$($Cache:SelectedRows.Name -join(', '))")
}
}
New-UDButton -Text "Submit Selection" -OnClick {
Show-UDToast -Message "Rows: $($Cache:SelectedRows.Count)"
}
New-UDTypography -Id "lblOutput" -Text "Select item(s)"