UDTable On Row Click

avatar

PSU 2026.1.2

I'm looking for a way to pop up additional information when clicking on a row (not selecting a row) in a UDTable. I know there's the expand row option, which opens an expand box below the row and there's the option of adding a custom button, but I was hoping there was a way to support clicking on the row and it could then support a code block (in my case, likely open a modal with the extended details of the row item).

For instance, the table would have like

 New-UDTable -LoadData {
  $Data } -Columns @(
    New-UDTableColumn -IncludeInExport -Id Id -Property Id -Title "Id" -Width 50
    New-UDTableColumn -IncludeInExport -Id ServerName -Property ServerName -Title "Server Name" -Width 150  
    New-UDTableColumn -IncludeInExport -Id CPUS -Property CPUS -Title "CPUs" 
    New-UDTableColumn -IncludeInExport -Id Memory_GB -Property Memory_GB -Title "Memory (GB)" 
    New-UDTableColumn -IncludeInExport -Id OperatingSystem -Property OperatingSystem -Title "Operating System" -Width 100
) -OnRowClick {
 Show-UDModal -Persistent -FullWidth -Content {
    New-UDCard -Content {
        New-UDGridLayout -Content {
            $VMData = Invoke-PSUEndpoint -Integrated -Url "/api/v1/VM/$($EventData.Id)" | ConvertFrom-Json
            New-UDTextbox -Id 'Id' -Label 'Id' -Value $EventData.Id -Disabled
            New-UDTextbox -Id 'ComputerName' -Label 'ComputerName' -Value $EventData.ServerName -Disabled
            New-UDTextbox -Id 'Department' -Label 'Department' -Value $VMData.Department -Disabled
            New-UDTextbox -Id 'Owner' -Label 'Owner' -Value $VMData.Owner -Disabled
            New-UDTextbox -Id 'State' -Label 'State' -Value $VMData.State -Disabled
        }
      }
    }
  }

And then when clicked on, it would display a bunch of additional information, like power state, health of tracked services, drives, other internal server tracking values that bloat the original table well beyond the width of the screen.

I know this could probably be done in an expand, but it requires you click on the dropdown button rather than just the row itself (and frankly looks ugly compared to a popup modal / so I'd just do a details button at that point), so I was hoping someone might have an idea or way to accomplish what I'm looking for as an on row click (anywhere in the row preferably).

All Comments (0)