2amigos / yii2-date-time-picker-widget

Bootstrap DateTimePicker Widget for Yii2
Other
44 stars 35 forks source link

Clear button problem #20

Closed dmdb closed 7 years ago

dmdb commented 7 years ago

Can't figure out how clear button works. Using simple configuration of widget in GridView filter:

    <?php Pjax::begin(); ?>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'username',
            'email:email',
            'created_at:datetime',
            [
                'attribute' => 'last_login',
                'format' => 'datetime',
                'filter' => DatePicker::widget([
                    'model' => $searchModel,
                    'attribute' => 'last_login',
                    'template' => '{addon}{input}',
                    'clientOptions' => [
                        'autoclose' => true,
                        'format' => 'yyyy-mm-dd',
                        'clearBtn' => true,
                    ],
                ])
            ],

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
    <?php Pjax::end(); ?>

Pushing clear does'nt reload GridView. Inputs val() clears, but actual attribute value - not. It seems that none of change event is firing also. Am I miss something simple? In other parts widget works just great.

dmdb commented 7 years ago

Iam sorry it seems, that is DatePicker Issue, not DateTimePicker.