I am using kartik grid view to display my data in yii 2 with pjax enabled. Every time, I search a data in the grid view, the search is done using ajax but the url keeps changing. Is there a way to keep the url unchanged? Please help me with the solution. Here is my code:
<?php use kartik\grid\GridView;?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'pjax'=>true,
'pjaxSettings'=>[
'neverTimeout'=>true,
],
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'hotel_id',
'name',
'address',
'phone_no',
'contact_person',
// 'email_address:email',
// 'website',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
You can disable pushState feature like this:
'pjax' => true,
'pjaxSettings' => [
'options' => [
'enablePushState' => false,
],
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With