When row selecting is enabled, the $EventData in -OnRowSelected or Get-Element on the table do not return an “id” or anything like it as shown in the example. I am looking at variable values from the copy-paste of the code from https://docs.ironmansoftware.com/dashboard/components/data-display/table#selection. In the example. the gif shows id field returned.
What I want to do: I need that field/or any some way of passing an invisible column “id” to find out which fields are selected and delete selected fields from an MSSQL table. Now that I am thinking about it, I am not sure how to make the transition of the “table” id, to my record id. I am already passing the id value in the object that is passed to Out-UDTableData, and using that to make a delete button column using $EventData.id inside the New-UDTableColumn -Render. With the new table select, I was hoping to add the ability to select multiple rows and delete them at once with a “delete” button, but again at a loss as to how to get which rows are selected without making an ID row that is visible for my users. Appreciate any suggestions.
you can used Get-udelement on the table main id , when you do that you will get the all table object inside this object you will have SelectedRows property that holds all the selected rows
Here is a sample of what I am trying to do(with debug-psudashboard in place in onclick events). Note the id value passed to Out-UDTableData. This is accessible in $EventData in New-UDTableColumn.
the id it’s not random we generate this id base on the data on the row and we do that for the server-side because if we don’t do that when you select rows and move to the next page and come back to the page that has selected rows, the rows won’t be selected anymore.
that said, you should have seen the real id and the generated one as uid, I don’t know if its a bug but I need to check, and come back to you
BTW can you change from id to something else like dataId or anything else except id
and see if you get this property back
I have tested changing the id field to dataid, and I do not get the property back. Not shown in screenshot, but I do not get the property in the Get-UDElement as well
I tested you code and you are correct, the id won’t pass to $EventData, but when i change it to dataId and even if its not showing up in the object i can get the value to display in the toast notification, its weird.
i need to do more tests