Can I somehow configure a gridview widget so that the table is updated using Pjax, but pagination links are normal links without Pjax?
Can I somehow configure a gridview widget so that the table is updated using Pjax, but pagination links are normal links without Pjax?
set data-pjax to 0 for your pagination links here as an example
<?php Pjax::begin() ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'pager' => [
'linkOptions' => [
'data-pjax' => 0
]
],
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'item_order',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
<?php Pjax::end() ?>
Many thanks!
However, it works in a strange way. After first pjax request the pagination links get spoiled. Say, the pagination links are:
/admin/list?page=1
/admin/list?page=2
…etc
I make pjax request to URL: /admin/update?id=100
After this, pagination links become:
/admin/update?id=100&page=1
/admin/update?id=100&page=2
Obviously, I need the pagination to remain the same.
UPD. As a workaround I disabled GridView’s pagination and implemented a separate paginator using yii\data\Pagination;