我有一个DatePicker小部件:
docker exec -ti container_name bash
dotnet --version
但是在选择约会时我没有看到任何事情发生,我缺少什么?
我尝试了两个DatePicker:
<?= $form->field($model, 'startDate')->widget(DatePicker::classname(), [
'clientOptions' => [
'maxViewMode' => 2,
'todayBtn' => "linked",
'daysOfWeekDisabled' => "0,1",
'autoclose' => true,
'onSelect' => new \yii\web\JsExpression('function(dateText, inst) { console.log(dateText, inst) }')
],
'language' => 'fr'
])?>
这是生成的javascript:
<div class="col-lg-4">
<?= $form->field($model, 'startDate')->widget(DatePicker::classname(), [
'clientOptions' => [
'maxViewMode' => 2,
'todayBtn' => "linked",
'daysOfWeekDisabled' => "0,1",
'autoclose' => true,
'onSelect' => new \yii\web\JsExpression('function(dateText, inst) { alert("Hi"); }')
],
'language' => 'fr'
])?>
</div>
<div class="col-lg-4">
<?= $form->field($model, 'stopDate')->widget(DatePicker::classname(), [
'clientOptions' => [
'maxViewMode' => 2,
'todayBtn' => "linked",
'daysOfWeekDisabled' => "0,1",
'autoclose' => true,
'onSelect' => 'alert("Hi")'
],
'language' => 'fr'
]) ?>
</div>
顺便说一下,这种语言也不起作用,也许两个问题都有联系?