0
我有,我會使用pjax喜歡使用分頁列表視圖但pagnation失敗pjax工作yii2 pjax在分頁失敗
這是我曾嘗試
<?php Pjax::begin([
'id' => 'w0', //checked id on the inspect element
'enablePushState' => true // i would like the browser to change link
]); ?>
<?= ListView::widget([
'summary' => false,
'dataProvider' => $dataProvider,
'emptyText' => "",//Yii::t('app', 'Sorry we have no items currently.'),
'itemOptions' => ['class' => 'item'],
'options' => ['data-pjax' => true ], //this is for pjax
'layout' => '{items}{pager}',
'pager' => [
'firstPageLabel' => 'First',
'lastPageLabel' => 'Last',
'maxButtonCount' => 5,
'options' => [
'class' => 'pagination col-xs-12'
]
],
'itemView' => function ($model, $key, $index, $widget) {
return $this->render('_items_list', ['model' => $model]); //This shows one model
},
]) ?>
<?php Pjax::end(); ?>
當我點擊這些項目什麼都沒有兜帽,當我刪除pjax打開和關閉標籤,它與正常頁面刷新一起工作還有什麼我需要添加