When you select a date, the date correctly enters the input field. However, the calendar itself, despite the fact that the date has already been selected, does not disappear. enter image description here

Here is the code:

<?= $form->field($model, 'date_complete')->widget(DatePicker::classname([ 'options' => [ 'style' => 'width: 40%;', ], 'pluginOptions' => [ 'language' => 'ru', 'todayHighlight' => true, 'format' => 'dmy', 'type' => DatePicker::TYPE_BUTTON, ], ] )); ?> 

    2 answers 2

    You need to add 'autoclose' => true in pluginOptions

    • Before that I added, no result - Bumerang37
    • ctrl + f5 did? demos.krajee.com/widget-details/datetimepicker there are many examples - ErroR
    • Yes of course. Even through yii cache / flush-all cleaned - Bumerang37
    • one
      Try to open the source code in the browser on the page with DatePicker`rom and post autoclose there. If you do not find the type of such jQuery ('# someid ..') ..... datepicker ({"clearBtn": true, "toggleActive": true, "autoclose": true, ".... it means the parameter does not fall into javascript and see if you add it - ErroR
     'pluginOptions' => [ 'autoclose'=>true, ]