From ddb7f4f77f06ca1f6b0473bc0c6078e379f5c361 Mon Sep 17 00:00:00 2001 From: pxpm Date: Fri, 10 Oct 2025 16:37:35 +0100 Subject: [PATCH 1/2] add modal form docs --- 7.x-dev/base-components.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/7.x-dev/base-components.md b/7.x-dev/base-components.md index 139b2d7..ac02028 100644 --- a/7.x-dev/base-components.md +++ b/7.x-dev/base-components.md @@ -90,7 +90,7 @@ These are the components that Backpack uses inside the default CRUD operations. ![Backpack v7 Dataform component](https://backpackforlaravel.com/uploads/v7/dataform_component.jpg) -This component helps you show a form _anywhere you want_, so the admin to easily create or edit an entries for an Eloquent model. The dataform component is a extension of a CrudController - so a CrudController for that entity needs to be already set up, and passed to this component as a parameter: +This component helps you show a form _anywhere you want_, so the admin can easily create or edit an entries for an Eloquent model. The dataform component is a extension of a CrudController - so a CrudController for that entity needs to be already set up, and passed to this component as a parameter: ```html @@ -118,6 +118,38 @@ This component helps you show a form _anywhere you want_, so the admin to easily
+ +### Dataform Modal + +![Backpack v7 Dataform Modal component](https://backpackforlaravel.com/uploads/v7/dataform_component.jpg) + +This component helps you show a form _anywhere you want_ inside a modal, so the admin can easily create or edit an entry for an Eloquent model without having to refresh the whole page. The dataform modal component is a extension of a CrudController - so a CrudController for that entity needs to be already set up, and passed to this component as a parameter: + +```html + +``` + +**Configuration options:** +- `name='invoice_form'` - by default, a name will be generated; but you can pick one you can recognize; +- `operation='create'` - by default, the datatable component will pick up everything that controller sets up for the Create operation; if you want to change the operation it will initialize, you can pass this parameter; +- `:entry="\App\Models\Invoice::find(1)"` - if you want to use UpdateOperation or a custom form operation that needs the entry; +- `:setup="function($crud, $parent) {}"` - if you want to make changes to the operation setup (eg. add/remove fields, configure functionality), you can use this parameter; the closure passed here will be run _after_ the setup of that operation had already completed; + +**Advanced example:** + +```html + +``` +
+ ### Datatable From a9f03c199982e093f717dc73daf438ff4909242f Mon Sep 17 00:00:00 2001 From: pxpm Date: Fri, 10 Oct 2025 17:42:45 +0100 Subject: [PATCH 2/2] wip --- 7.x-dev/base-components.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/7.x-dev/base-components.md b/7.x-dev/base-components.md index ac02028..fa9f63a 100644 --- a/7.x-dev/base-components.md +++ b/7.x-dev/base-components.md @@ -150,6 +150,8 @@ This component helps you show a form _anywhere you want_ inside a modal, so the ```
+> **NOTE**: The tinymce and date_picker (jquery version) does not properly work in this context. Please use any alternative. + ### Datatable