Bootstrap pagination and disabled pjax

I’m using Yii2 2.0.42.1. on my gridview i’ve changed to to POST and disabled pjax.

<?php Pjax::begin(['id'=>'id-pjax', 'timeout'=>false, 'enablePushState' => true, 'clientOptions' => ['type' => 'POST', 'url' => Url::to(['/test/default/dashboard'])]]); ?>

<?= GridView::widget([
                'dataProvider' => $dataProvider,
                'filterModel' => $searchModel,
                'filterPosition' => \yii\grid\GridView::FILTER_POS_HEADER,
                'pager' =>[
                    'linkOptions'=> ['data-pjax' => '0'],
                    'class' => \yii\bootstrap4\LinkPager::class,
                ],
                ....
]); ?>

<?php Pjax::end(); ?>

when i add 'linkOptions'=> ['data-pjax' => '0'], the pagination doesn’t become bootstrap pagination, but the pagination works.

when i remove 'linkOptions'=> ['data-pjax' => '0'], the pagition UI is bootstrap, but pagination doesn’t work at all

any idea how to fix this? I also have multiple gridviews on the same page.

Pagination should be part of Pjax, otherwise it does not make sense to wrap the gridview in pjax.

I also have multiple gridviews on the same page.

If you have multiple gridviews in one page you need to configure pagination and sort params, check the guide at:

https://www.yiiframework.com/doc/guide/2.0/en/output-data-widgets#multiple-gridviews