You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,17 +164,21 @@ With this package your are also able to add a create button for the foreign CRUD
164
164
165
165
### Modal view
166
166
167
-
By default the modal is loaded automatically by using `entity` in `on_the_fly` of the field definitionresulting in `backpack_url($field['on_the_fly']['entity']).'/ajax/create'`in the field blade.
167
+
By default the modals are loaded automatically by using `entity` in `on_the_fly` of the field definition, e.g. resulting in `backpack_url($field['on_the_fly']['entity']).'/ajax/create'`for the create modal.
168
168
169
-
You can overwrite this behavior by setting a `create_view` attribute:
169
+
You can overwrite this behavior for all modals by setting an attribute:
170
170
171
171
```
172
172
'on_the_fly' => [
173
173
'entity' => 'entity',
174
-
'create_view => 'route/to/modal/html'
174
+
'create_modal' => 'route/to/modal/html',
175
+
'edit_modal' => 'route/to/modal/html',
176
+
'delete_modal' => 'route/to/modal/html',
175
177
]
176
178
```
177
179
180
+
> Please be aware that by using this attributes you will be completely responsible for the content of the modal! The defined request has to provide valid HTML which is then filled in `<div class="modal-content"></div>`
181
+
178
182
### Search logic
179
183
180
184
The "instant field" triggers the `ajaxIndex()` of the `EntityCrudController` where the field is defined and uses the fields `model` and `attribute` parameters to perform the search on the foreign model.
0 commit comments