UDGrid Data is Empty

So, I have a UDGrid setup that has a button in each row, when the button is clicked it will open up a UDModal with another UDInput and UDGrid inside.

When I entered / select data - data is selected and updated in the array - I can also see the UDgrid row were added as well. However, the data in UDgrid is empty. Any idea?

I can see these errors - looks like it is running in an endless loop? Perhaps, the auto refresh? I have disabled auto refresh in the nested UDgrid - except the one with the button.

image

image

Nothing out of ordinary in the UD log - everything looks pretty normal. I can see the data in the converttoactionresult. Weird the UDgrid has a blank no text row although the row is there. Has anyone seen this before?

@adam - Any idea what does this error means?

https://reactjs.org/docs/error-decoder.html/?invariant=18

Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

I would assume - I can’t do UDgrid / UDTable nested under UDgrid? Hm.

Only going by the error code it seems you have an infinite loop going on…I see you kindly shared a picture, but you ok to put the code for when you press the button, as it seems there is where your problem lies

So, the button is configured in a PScustomObject. It looks like below.

    Add2ndPostResp          = New-UDTooltip -TooltipContent { "Add Secondary Responsibility & Position" } -Place bottom -Content { 

    New-UDButton -Icon plus -Style @{color = '#FFFFFF' }   -OnClick ( New-UDEndpoint -Endpoint { 

            Show-UDModal -Content {



                New-UDElement -Id 'usersresppost' -Tag 'div' -Endpoint {

                    # New-UDGrid -NoExport -NoFilter  -Title "ADD USER - SECONDARY RESPONSIBILITY & POSITION : " -Headers @("Secondary Responsibility", "Secondary Position") -Properties @("SecondResponsibility", "SecondPosition") -Endpoint {

                    New-UDTable -Title "ADD USER - SECONDARY RESPONSIBILITY & POSITION : " -Headers @("Secondary Responsibility", "Secondary Position") -Endpoint {

                        $session:user_resppost | Out-UDTableData -Property  @("SecondResponsibility", "SecondPosition")

                        #$session:user_resppost | Where-Object { $_.LDAP -eq $userID } | Out-UDGridData

                    } -AutoRefresh           

                }

                New-UDInput -Content {



                    New-UDInputField -Type select -Name SecondResponsibility  -Placeholder "Secondary Responsibility" -Value $cache:user_responsibility

                    New-UDInputField -Type select -Name SecondPosition -Placeholder "Secondary Position" -Value $user_position

            

                } -Endpoint { param($SecondResponsibility, $SecondPosition)

                    New-UDInputAction -Content {

                        $resppostObj = [pscustomobject]@{

                            LDAP                    = $userID

                            Organization            = $organization

                            SecondaryResponsibility = $SecondResponsibility

                            SecondaryPosition       = $SecondPosition

                        }

                        $session:user_resppost.Add($resppostObj)

                        Sync-UDElement -Id 'usersresppost'

                    }

                } -SubmitText "+ ADD"

            } -Height 350px -Width 450px

        })

}

Are SecondReponsibility and SecondPosition strings or some kind of object?

$session:user_resppost | Out-UDTableData -Property  @("SecondResponsibility", "SecondPosition")

They are strings. User key it in the input field, and it writes to PS object.

@adam -

Did you figure something out?

Initially, both SecondResp and SecondPost was under the first UDgrid, everything display just fine. But user then requested for a button in that UDgrid, where they can enter the information and display data in the modal under a different PSobject and array object.

Data is captured fine to the array, but it does not display it in the UDtable or UDgrid under the modal. Occassionally getting the error React 158, my bet is the auto refresh. Or is this the sync UDelement since its nested under another UDgrid?

UPDATE:

It worked now.