Answer the question
In order to leave comments, you need to log in
Why doesn't js code work inside my modal window?
The modal is rendered with renderAjax and replaces the . As a result, it turns out that some components that were connected using js are not initialized and cannot, I don’t understand why. Here is the code
<?php
namespace frontend2\views;
use yii\web\AssetBundle;
class LKAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
];
public $js = [
'/lk/static/js/script.js?v=1.1.2',
'/lk/static/js/vendor.js',
];
public $depends = [
'yii\web\YiiAsset',
//'yii\bootstrap\BootstrapAsset',
];
public $jsOptions = ['position' => \yii\web\View::POS_HEAD];
}
LKAsset::register($this);
<?= Html::input('money', 'RegistryArkBanks[contract_sum]', Html::encode($model->contract_sum), [
'class' => 'input _fill'
]) ?>
<?= Html::input('datepicker', 'RegistryArkBanks[date_start_overdue]', !empty($model->date_start_overdue) ? date('Y-m-d', $model->date_start_overdue) : null, [
'class' => 'input _fill'
]) ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question