Card / Window Modals
Card modals display other pages as their content.
This element is based on the vue js modal module.
Card Modals are a special type of modal that show the contents of another page as their contents.
They are opened with an showCardModal
action and hidden with a hideCardModal
action.
Options
The following items can exist in the options object for the showCardModal
action. Either slug
or idForm
must be present to identify the page loaded in the card modal. See source docs for a complete list of additional parameters.
Changing paths / page contents, use a path
action with added windowName
key to target the correct window, in this case the name of this modal.
Passing Parameters
Often you need to pass some params to the modal from the parent page. These fall within situations, with or without the onFormRequest
hook enabled.
With onFormRequest
enabled
onFormRequest
enabledWhen called from another (parent) page. If you need onFormRequest
params, use the query
key as you would with other pages and read via the $$BF_Query
global in your hook script.
Without onFormRequest
enabled
onFormRequest
enabledWhen showing a modal and you don't need to call a server hook script you can still pass data to modal several ways.
Via the
model
key. data in the key will appear in themodel
for the modal. This is useful when you want to edit some detail information that the parent form already has.Via the
app
object. By setting a key within theapp
object, and then later reading that when the form loads, you can pass anything back and forth between parent and modal.
Last updated