Download the PHP package loveorigami/yii2-modal-ajax without Composer
On this page you can find all versions of the php package loveorigami/yii2-modal-ajax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download loveorigami/yii2-modal-ajax
More information about loveorigami/yii2-modal-ajax
Files in loveorigami/yii2-modal-ajax
Package yii2-modal-ajax
Short Description A wrapper around Yii2 Bootstrap Modal for using an ActiveForm via AJAX inside
License MIT
Homepage https://github.com/loveorigami/yii2-modal-ajax
Informations about the package yii2-modal-ajax
Yii2-modal-ajax
A wrapper around Yii2 Bootstrap Modal for using an ActiveForm via AJAX inside.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json file.
Usage
Controller
Extend your basic logic with ajax render and save capabilities:
to
View
Usage in grid
Index View - Create (Single Modal Mode)
Index View - Update (Multi Modal Mode)
Modal Ajax with events
Plugin Events
On top if the basic twitter bootstrap modal events the following events are triggered
kbModalBeforeShow
(ModalAjax::EVENT_BEFORE_SHOW)
This event is triggered right before the view for the form is loaded. Additional parameters available with this event are:
xhr
: XMLHttpRequest, the jQuery XML Http Request object used for this transaction.settings
: object, the jQuery ajax settings for this transaction.
kbModalShow
(ModalAjax::EVENT_MODAL_SHOW)
This event is triggered after the view for the form is successful loaded. Additional parameters available with this event are:
data
: object, the data object sent via server's response.status
: string, the jQuery AJAX success text status.xhr
: XMLHttpRequest, the jQuery XML Http Request object used for this transaction.selector
: object, the jQuery selector for embed logic after submit in multi Modal.
kbModalShowComplete
(ModalAjax::EVENT_MODAL_SHOW_COMPLETE)
This event is triggered when ajax call is completed when the form is loaded. Additional parameters available with this event are:
xhr
: XMLHttpRequest, the jQuery XML Http Request object used for this transaction.textStatus
: string, the jQuery AJAX success text status for this transaction.
kbModalBeforeSubmit
(ModalAjax::EVENT_BEFORE_SUBMIT)
This event is triggered right before the form is submitted. Additional parameters available with this event are:
xhr
: XMLHttpRequest, the jQuery XML Http Request object used for this transaction.settings
: object, the jQuery ajax settings for this transaction.
kbModalSubmit
(ModalAjax::EVENT_MODAL_SUBMIT)
This event is triggered after the form is successful submitted. Additional parameters available with this event are:
data
: object, the data object sent via server's response.status
: string, the jQuery AJAX success text status.xhr
: XMLHttpRequest, the jQuery XML Http Request object used for this transaction.selector
: object, the jQuery selector for embed logic after submit in multi Modal.
kbModalSubmitComplete
(ModalAjax::EVENT_MODAL_SUBMIT_COMPLETE)
This event is triggered when ajax call is completed when the form is submitted. Additional parameters available with this event are:
xhr
: XMLHttpRequest, the jQuery XML Http Request object used for this transaction.textStatus
: string, the jQuery AJAX success text status for this transaction.