afterInit event for yiiActiveForm

https://github.com/yiisoft/yii2/issues/12744
This commit is contained in:
werew01f
2016-10-14 17:17:56 +03:00
committed by GitHub
parent fa9675636b
commit 1bd13e233b

View File

@ -100,7 +100,15 @@
* - jqXHR: a jqXHR object * - jqXHR: a jqXHR object
* - textStatus: the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). * - textStatus: the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror").
*/ */
ajaxComplete: 'ajaxComplete' ajaxComplete: 'ajaxComplete',
/**
* afterInit event is triggered after yii activeForm init.
* The signature of the event handler should be:
* function (event)
* where
* - event: an Event object.
*/
afterInit: 'afterInit'
}; };
// NOTE: If you change any of these defaults, make sure you update yii\widgets\ActiveForm::getClientOptions() as well // NOTE: If you change any of these defaults, make sure you update yii\widgets\ActiveForm::getClientOptions() as well
@ -217,6 +225,8 @@
}); });
$form.on('submit.yiiActiveForm', methods.submitForm); $form.on('submit.yiiActiveForm', methods.submitForm);
} }
var event = $.Event(events.afterInit);
$form.trigger(event);
}); });
}, },