S
S
Sergey Beloventsev2018-06-19 13:09:20
Yii
Sergey Beloventsev, 2018-06-19 13:09:20

How to catch kartik-v/datepicker date delete event?

I think many people use this plugin
, I need to catch the date deletion event (I use the widget as a filter in the index) here is the code

[
             'attribute'=>'expirationDate',
             'label'=>'Поставлен на учет до',

             'filter' => DatePicker::widget([
          'name' => 'EmployeeSearch[expirationDate]',
          'value' => $redisString,
          'pluginOptions' => [
            'autoclose'=>true,
            'format' => 'yyyy-mm-dd'
          ],
                    'pluginEvents'=>[
                        "clearDate" => "function(e) { 
                            e.preventDefault;
                            console.log(e);
                        }",
                    ]
        ]),
             'value'=>function($model){
                ...
             }
         ],

the date is removed and the page is refreshed. What am I doing wrong ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-06-19
@webinar

I think the widget has nothing to do with it, most likely you wrapped it in pjax or another script. Try the same on a blank page to exclude the environment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question