I’m using Kartik Gridview and Pjax inside a modal. When I tried to filter something, the ajax filter works fine, but after that, the page is reloaded. What could be the cause? Please help.
use yii\bootstrap\Modal;
use kartik\grid\GridView;
use frontend\components\LabelComponent;
use yii\widgets\Pjax;
Modal::begin(['header' => '<h3>Member List</h3>', 'id' => 'modal-browse-member']);
GridView::widget([
'id' => 'browse-member-grid',
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'pjax' => true,
'pjaxSettings' => [
'neverTimeout' => true,
],
'summary' => LabelComponent::GRID_SUMMARY,
'columns' => [
'member_card_number',
'member_name',
[
'attribute' => 'member_address',
'format' => 'raw',
],
'member_phone1',
'member_phone2',
[
'attribute' => 'member_type',
'value' => function ($model, $key, $index, $column){
return $model->getTypeLabel($model->member_type);
},
'filter' => $searchModel->getTypeLabel(),
],
],
]);
Modal::end();