TableWidget Actions not working as expected
I'm trying to add actions to a WidgetTable, but the actions don't work as expected. When clicking on the Edit link, it appears to call the Save method as I get a notification in the upper right that it was saved. Where am I going wrong?
7 Replies
you havent passed a ->form()
what value do I pass in ->form('what_form')?
I'm having all kinds of fun trying to get actions to work in TableWidgets. In addtion to the edit/delete links, I'm trying to get an Add Resource button to the widget, but falling short.
I think I'm on to something...
all coming together:
DeleteAction::make(),
still having an issue adding an "Add Resource" button to the widget, but the actions all work.
hmmm
just pass the array directly to form()
form([TextInput::make()])
I was trying to get the "Add Resource" button to show up in the table header of the TableWidget, like it does the table when viewing that table using the auto generated resource view page. I tried this, but it didn't make the button show up on the TableWidget:
user error, I got the button to show up now using the above method, I just need to redirect it to the correct create form.
got it all working with this:
you dont need all of this
you just pass an array of fields to the form()
this is a long way of just getting a simple array
form([Select…])
Wasn't sure how to flush out your suggestion, is this closer?
yup thats it