New-UDTable Main Post

I open this thread so we can track all the issues related to the new table that we introduced in version 3.

I start with the know issues

Table crash when -Data is empty.

we know and we are working on fixing this bug.

when we build this table we only give the option that data can be empty if you are using server-side, that’s meant using parameter -LoadData and Out-UDTableData, we didn’t think of empty data when the data is static.

PageSize and PageSizeOptions

those are fixed and the fix will be in the up coming release.

Row selection

in order to use row selection, you need to use the parameter -OnRowSelection
inside the row selection script block, you have access to $EventData, it should hold all the info about the selected row.
this script block only runs when you select a row NOT deselect the row.

if you want to get all the selected rows from the table you need to use Get-UDElement -Id in the return object you will have a property named SelectedRows, that holds all the selected rows as objects.

You don’t see the table id in the HTML code

this is a bug and was fixed, the fix will be in the upcoming release

people using this id to style the table or to get access to nested table nodes for styling.

Export data

the export option in the new table have 2 properties that build the all export stuff

on the New-UDTable you have a switch parameter named -ShowExport or alias -Export this will control if the table display an export button or not

the second part is on the column, New-UDTableColumn has a property named -IncludeInExport or alias -Export this control when you export the data if that column show is included in the export.

if you only specified -Export on the New-UDTable and didn’t use -IncludeInExport on any column you will get an empty file with no data. so please use -IncludeInExport for the columns that you want to.

Search data

the search option in the new table has 2 parts

on the New-UDTable you have a switch parameter named -ShowSearch or alias -Search this will control if the table displays the search input control button or not

the second part is on the column, New-UDTableColumn has a property named -IncludeInSearch or alias -Search this control if this column will be searchable

if you only specified -Seach on the New-UDTable and didn’t use -IncludeInSearch on any column you won’t see any results when searching.

Notes

We are working on updating and adding new examples related to the new-udtable in our docs

if you have any issue with the New Table please post the issue here

1 Like

Search does not seem to be working for me, having the same issue as described here:

Also a documentation issue, I was having trouble with the -Padding parameter, trying to use Dense padding. Turns out the correct parameter is -Dense. This is reflected in some of the examples, but the parameter documentation here seems wrong:
https://docs.ironmansoftware.com/dashboard/components/data-display/table

you need to use -IncludeInSearch on the columns that you want to be included in the search, and -ShowSearch to display the search input on the top, by default no columns are included in the search

That fixed it, thanks!

1 Like

Hi, thanks for this information.
I am just wondering about the default sort that seems to be enabled on the first column.
I have built tables that “sort” the information in a special order, not by descending or ascending.
Is there any plan to change this back, or an option/switch to remove it?

Thanks!

I think we can change the behavior of this, so by default, no sorting will happen

Hey @AlonGvili !

Thanks for that new table, it’s pretty cool !

I was wondering if you may be able to configure the table in order to be able to click on the row and have a -OnRowClick for instance in order to act only on one record instead of using the row selection check box ? it would be neat if that’s possible ! many thanks in advance !

I think it can be done, i will check your suggestion

@AlonGvili
Is there any update/status/plan for this?
Removing this sort would be the last thing i need to “launch” my new Dashboard :slight_smile:

we thinking to disabled the default sorting, I don’t think we put this fix in the upcoming release but I will try to push it in.

Some Updates,

we fix table won’t render if $Data is $null ( empty ),
we fix table filter auto reset
we removed the default sort column from the first column if no default sort column was specified
we fix that table show React error some times, when cell value was undefined or null

Update
we fixed - table data won’t be update using Set-UDElement
now you can just do

Set-UDElement -Id '<Your table id in here>' -Properties @{
    Data = @(
      "your new data"
   )
}

we still working on some bugs.
just wanna update you guys on the table progress.

2 Likes

Dear All
I’m really sorry to re-open this post.

However I still get the issues described here and for example here:

Even if I use the new Set-UDElement Function described above I get
“Cannot read property ‘version’ of undefined”.

From what I learned searching the forum this issues should have been resolved.
The question is therefore: What am I doing wrong?

For your Information, this is what I’m trying to do:

function get-RemoteUsers {

    try `

    {       

        Get-ADUser -ea Stop -SearchBase "OU=MyOU,OU=MyOrganisation,DC=demolab,DC=local" -SearchScope OneLevel -Properties Description, Company, mail, manager, accountExpires -LDAPFilter "(&(&(&(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)))))" | Select-Object `

        @{ Label = "Name"; Expression = { ($_.Name) } },

        @{ Label = "Username"; Expression = { ($_.saMAccountName) } },

        @{ Label = "EMail"; Expression = { ($_.mail) } },

        @{ Label = "Company"; Expression = { ($_.company) } },

        @{ Label = "Description"; Expression = { ($_.description) } },

        @{ Label = "Responsible"; Expression = { 

           (Get-ADUser -Identity $_.manager).name

           } },

        @{ Label = "Expiration Date"; Expression = { `

        

            if ($_.accountExpires -eq 0)

            {

                "Never"

            }

            elseif ($_.accountExpires -eq 9223372036854775807)

            {

                "Never"

            }

            else

            {

                $expirationDate = [datetime]::FromFileTime($_.accountExpires)

                $expirationDate.AddDays(-1).ToString("dd.MM.yyyy")

                #([datetime]::FromFileTime($_.accountExpires).toString("dd.MM.yyyy"))

                # $expirationDate.toString("dd.MM.yyyy")

            }

        

            }

        }

    }

    catch 

    {

    }

The UDTable gets initially created like that:
New-UDCard -Title “Query Results” -Content {

       # New-UDTable -Id 'extuser_table' -Data $Data -Columns $Columns -Title 'External Users' -ShowSearch -ShowSort -PageSize 20 -ShowPagination -ShowSelection -Dense -OnRowSelection {

           

        $dataquery = get-RemoteUsers

        New-UDTable -Id 'extuser_table' -Data $dataquery -Columns $Columns -ShowSort -PageSize 20 -ShowPagination -ShowSelection -Dense -OnRowSelection {

           $Item = $EventData

           # Show-UDToast -Message "$($Item).name"

       }

But then when I try to update the table using a simple button like that it doesn’t work:

New-UDButton -Text "GET Rows" -OnClick {
      Set-UDElement -Id 'extuser_table' -Properties @{
         Data = get-RemoteUsers
         }  
     }

Thanks a lot for your much appreciated help!

Best regards,
Don

Hi Don,

Can you try using Sync-UDElement and a dynamic instead of Set-UDElement? I don’t know exactly why this isn’t working with Set-UDElement but this may work for you.

New-UDDynamic -Id 'myTable' -Content {
    $dataquery = get-RemoteUsers

        New-UDTable -Id 'extuser_table' -Data $dataquery -Columns $Columns -ShowSort -PageSize 20 -ShowPagination -ShowSelection -Dense -OnRowSelection {

           $Item = $EventData

           # Show-UDToast -Message "$($Item).name"

       }
}

Then the button would be:

New-UDButton -Text "GET Rows" -OnClick {
Sync-UDElement -Id 'myTable'
     }

Dear Adam

Thanks a lot! You’re the man! It works just great like you described! THANK YOU!!
Just a suggestion:

Maybe it would be good to put this little howto in the docs example for UDTable? :slight_smile:

I’m sure this will be needed quite often… :wink:

Best regards and take care,
Don

Sure thing! Thanks.