Getting Create New Record button in table header to open in a modal

I am having a tough time getting the Create/Edit form of a resource to open inside a modal instead of a separate page. I can get modals to work for custom actions, but I am not able to get the create and edit versions to the same. ChatGPT is suggesting this:
->headerActions([
CreateAction::make() // This will add the "Create" button to the table header
->modalHeading('Create a New Top-Level Domain') // Optional: Customize modal heading
->modalButton('Add Domain') // Optional: Customize modal button text
->successNotificationMessage('Top-Level Domain Created Successfully.') // Success notification
])
->headerActions([
CreateAction::make() // This will add the "Create" button to the table header
->modalHeading('Create a New Top-Level Domain') // Optional: Customize modal heading
->modalButton('Add Domain') // Optional: Customize modal button text
->successNotificationMessage('Top-Level Domain Created Successfully.') // Success notification
])
This makes sense, and from what I can gather from the documentation, I think this should work; however, it always displays as a regular page. Am I missing something obvious, or perhaps should I be making these changes in the EditResource page instead?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?