Hi everyone
i want to use a range slider in the gridview search filter but when i add it in the gridview filter it works funny.
As soon as user clicks on the slider it triggers ‘applyfilter’ continuously.
I want the applyfilter to only trigger when slider stops and not when user clicks on slider.
I am using code like below.
<?= GridView::widget([
'id'=>'checkin-table',
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'showOnEmpty'=>true,
'columns' => [
[
'class' => 'yii\grid\CheckboxColumn',
'multiple'=>true,
],
[
'attribute' => 'email',
'label' => 'Email',
'value' => 'users.email',
],
[
'attribute' => 'gender',
'label' => 'Gender',
'value' => 'users.gender',
],
[
'attribute' => 'age',
'label' => 'Age',
'value' => 'users.age',
'filter' => Slider::widget([
'name'=>'ageRange',
'value'=>$range,
'sliderColor'=>Slider::TYPE_GREY,
'pluginOptions'=>[
'min'=>0,
'max'=>100,
'step'=>1,
'range'=>true
],])
],
'user_type',
],
]);
?>
But like i said when i use it like this as soon as user clicks on the slider it sends request continuously to the server for filter data.
I want that to apply only when slider stops.
Let me know if any way to do that.