Revision #243 has been created by rackycz on Oct 8, 2020, 2:41:47 PM with the memo:
Modal and ajax
« previous (#242) next (#244) »
Changes
Title
unchanged
Yii v2 snippet guide
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2
Content
changed
[...]
// This section can be moved to "\views\layouts\main.php"
yii\bootstrap\Modal::begin([
'header' => '<span id="myModalTitle">Title</span>',
'id' => 'myModalDialog',
'size' => 'modal-lg',
'clientOptions' => [
// https://getbootstrap.com/docs/3.3/javascript/#modals-options
'keyboard' => false, // ESC key won't close the modal
'backdrop' => 'static', // clicking outside the modal will not close it
],
]);
echo "<div id='myModalContent'></div>";
yii\bootstrap\Modal::end();
$this->registerJs(
"// If you use $(document).on, it will handle also events on elements rendered by AJAX.[...]