Skip to content

Commit 63f4ecc

Browse files
committed
wip
1 parent a9f03c1 commit 63f4ecc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

7.x-dev/base-components.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ This component helps you show a form _anywhere you want_, so the admin can easil
9797
```
9898

9999
**Configuration options:**
100-
- `name='invoice_form'` - by default, a name will be generated; but you can pick one you can recognize;
101100
- `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;
102101
- `:entry="\App\Models\Invoice::find(1)"` - if you want to use UpdateOperation or a custom form operation that needs the entry;
103102
- `: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;
@@ -123,16 +122,17 @@ This component helps you show a form _anywhere you want_, so the admin can easil
123122

124123
![Backpack v7 Dataform Modal component](https://backpackforlaravel.com/uploads/v7/dataform_component.jpg)
125124

126-
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:
125+
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.
126+
127+
To use this component you are required to add `CreateInModalOperation` and/or `UpdateInModalOperation` in your CrudController. 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:
127128

128129
```html
129130
<x-bp-dataform-modal controller="\App\Http\Controllers\Admin\InvoiceCrudController" />
130131
```
131132

132133
**Configuration options:**
133-
- `name='invoice_form'` - by default, a name will be generated; but you can pick one you can recognize;
134-
- `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;
135-
- `:entry="\App\Models\Invoice::find(1)"` - if you want to use UpdateOperation or a custom form operation that needs the entry;
134+
- `operation='createInModal'` - by default, the 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, eg: `updateInModal`
135+
- `:entry="\App\Models\Invoice::find(1)"` - if you want to use UpdateInModalOperation or a custom form operation that needs the entry;
136136
- `: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;
137137

138138
**Advanced example:**
@@ -141,7 +141,7 @@ This component helps you show a form _anywhere you want_ inside a modal, so the
141141
<x-bp-dataform-modal
142142
controller="\App\Http\Controllers\Admin\InvoiceCrudController"
143143
name="invoice_form"
144-
operation="update"
144+
operation="updateInModal"
145145
:entry="\App\Models\Invoice::find(1)"
146146
:setup="function($crud, $parent) {
147147
$crud->removeColumn('notes');
@@ -150,7 +150,7 @@ This component helps you show a form _anywhere you want_ inside a modal, so the
150150
```
151151
<hr>
152152

153-
> **NOTE**: The tinymce and date_picker (jquery version) does not properly work in this context. Please use any alternative.
153+
> **NOTE**: The date_picker (jquery version) does not properly work in this context. Please use any alternative.
154154
155155
<a name="datatable"></a>
156156
### Datatable

0 commit comments

Comments
 (0)