在kartik-v/yii2 grid kartik Gridview中禁用分页
如何在Kartik Gridview中禁用分页? 我使用的代码如下在kartik-v/yii2 grid kartik Gridview中禁用分页,yii2,Yii2,如何在Kartik Gridview中禁用分页? 我使用的代码如下 echo GridView::widget([ 'dataProvider'=>$dataProvider, 'filterModel'=>$searchModel, 'showPageSummary'=>true, 'responsive'=>true, 'hover' => true,
echo GridView::widget([
'dataProvider'=>$dataProvider,
'filterModel'=>$searchModel,
'showPageSummary'=>true,
'responsive'=>true,
'hover' => true,
'pjax'=>true,
'containerOptions'=>['style'=>'overflow: auto'], // only set when $responsive = false
'headerRowOptions'=>['class'=>'kartik-sheet-style'],
'filterRowOptions'=>['class'=>'kartik-sheet-style'],
'striped'=>true,
'hover'=>true,
'pager' => [
'options'=>['class'=>'pagination'], // set clas name used in ui list of pagination
'prevPageLabel' => 'Previous', // Set the label for the "previous" page button
'nextPageLabel' => 'Next', // Set the label for the "next" page button
'firstPageLabel'=>'First', // Set the label for the "first" page button
'lastPageLabel'=>'Last', // Set the label for the "last" page button
'nextPageCssClass'=>'next', // Set CSS class for the "next" page button
'prevPageCssClass'=>'prev', // Set CSS class for the "previous" page button
'firstPageCssClass'=>'first', // Set CSS class for the "first" page button
'lastPageCssClass'=>'last', // Set CSS class for the "last" page button
'maxButtonCount'=>10, // Set maximum number of page buttons that can be displayed
],
'panel'=>['type'=>'primary', 'heading'=>'Select Option to Publish Policy'],
'columns'=>[
['class'=>'kartik\grid\SerialColumn'],
['class' => 'kartik\grid\CheckboxColumn',
'rowSelectedClass' => GridView::TYPE_INFO,
'name' => 'id',
'contentOptions' => function ($model, $key, $index, $column){//print_r($model);
return ['username'=>$model->username];
},
'checkboxOptions' => function ($model, $key, $index, $column) {
return ['key' => $model->username, 'value' => $model->username];
},
],
],
]);
我尝试将
pageSize
和pagination
添加到false
,但没有成功。无分页意味着显示所有实例,然后可以设置pageSize=0
$dataProvider->pagination->pageSize=0;
或者你可以使用
$dataProvider->pagination = false;