Modal on top of antoher modal

Product: PowerShell Universal
Version: 4.2.12

I found quite similar topic on forum but its old (from 2021) so maybe something changed in the meantime, and frankly i don’t understand solution fully yet.
But maybe get the to the problem.
Iv got a table , its showed in the modal (it pops up when user click button). in each row ive got a button to edit data in this row. when user click this button another modal pops up with udtextbox to edit fields.

And the problem is that this new modal closes this modal with table. and when i close modal with row edit user is back to main dash.

So few question:

  1. is there any switch to make this first modal persistent and make one modal on top of another ?
  2. is there any other better way to edit data in the table ? (maybe in table itself ??)

Few mentions: im using pages so i cant (as far i understand) use functions , maybe i can create module with this modal creation and call it in the page, but im looking for a simple way to achieve it first.

ok answering question nr 2
I can use New-UDDataGrid. It allows on page editing of values.
I can edit it - in theory :slight_smile:
I can add check box to each row (to select it for deletion)
But how to retrieve those changed data ?
I cant find a property to read which rows has been checked
Also when i change some value in rows command

(Get-UDElement -Id 'dataGrid1').data.rows

contains old values not new

I know there is OnEdit switch that shows $Body variable with old and new values
But im want it to work in the way that user is able to change some values or check some rows for deletion and when delete button is clicked i can read which rows were chceked, delete those rows from input array and then update ud element where UDDataGrid is.
The same with updating - user is is making some changes, and when save button is clicked i will read all rows one by one and update it values in input array. then the same - update ud element where UDDataGrid is.

Is it doable or i can achieve it in any other way ?

update nr 3
I managed to make the code for onedit block (by searching index of row where certain old value is present and replacing whole row with the new row in input array. kind of working i don’t know how it will behave with larger datasets but its enough for me

Still how to retrieve which row is selected by the checkbox ??

I don’t know it there is a smarter way now, but in older versions the method was to note which rows has been checked/unchecked by using an -onchange/oncheck block

onchange { # if true add ID to Collection; if false remove from collection}

hey, yes i have come to similar approach.
I assign selected rows to selected rows variable then when deleted button i clicked i read rows from input array

$all_rows = (Get-UDElement -Id dataGrid1).data.rows

and then i create new array where is not in selected rows variable

$new_uploaded_files = $all_rows  | Where-Object { $ -notin  $page:selected_rows }

Then i assign new variable to old and call element sync

Sync-UDElement -Id 'edit_table_dynamic'

Its working one thing that is still not right is that when i refresh this data grid selection is not cleared although data is

I have to close modal and display it once again to make it gone.

I can live with that but i wish that firstly - documentation for this is better - it was not obvious for me and secondly - i think for datagrid and table such things like editing and deleting/adding rows) should be implemented in more elastic way and low level way