TableWidget: Modal in View Actions empty data
What I'm trying to do: Show a modal when clicking on "View" within a TableWidget.
What I did: I created a custom widget that extends TableWidget. I added a view action that shows a modal for a user record. Even though the modal shows form elements, they are empty.
Code:
Additional Info:
I know I can just redirect the user to the /users/{id} route to view the record, but I really like the modal popup (it keeps them on the dashboard).
Question:
So is there a way I can bind the record to the form?
What I did: I created a custom widget that extends TableWidget. I added a view action that shows a modal for a user record. Even though the modal shows form elements, they are empty.
Code:
Additional Info:
I know I can just redirect the user to the /users/{id} route to view the record, but I really like the modal popup (it keeps them on the dashboard).
Question:
So is there a way I can bind the record to the form?

Solution
Hopefully this helps someone - I was able to solve this by passing
This is the
Now you can extend this class to show a specific resource such as Users:
Make sure that in your
->statePath('state'), this also requires that the Widget has this state defined as public, it will not work if not defined in the class.This is the
GenericTableWidgetNow you can extend this class to show a specific resource such as Users:
Make sure that in your
UserResource you have defined the static function getTableColumns: