The data bound to the row has a boolean property called hasLicense
. I would like the button to be disabled if that property is true. My current workaround is that I simply don’t add the button if the property is true. But this makes the rows that don’t have the button have less height that the rows that have the button, which just doesn’t look nice.
New-UDTableColumn -Property hasLicense -Title " " -Sort $false -Render {
if(!$EventData.hasLicense)
{
New-UDButton -Id "btn$($EventData.id)" -Text "add to $serialNumber" -OnClick {
Show-UDToast -Message ($EventData | ConvertTo-JSON)
Show-UDToast -Message "Entitlement deleted." -BackgroundColor Green -MessageColor white
Sync-UDElement -Id 'entitlement-region'
}
}
}
Product: PowerShell Universal
Version: 1.5.4