2015-07-08 14:14:28 3310次浏览 2条回答 0 悬赏 0 金钱
echo GridView::widget([
    'dataProvider'=> $dataProvider,
    'columns' => $gridColumns,
    'export'=> false,
    'toolbar' => [
        [
            'content'=>
            Html::button('<i class="glyphicon glyphicon-plus"></i>', [
                'type'=>'button',
                'title'=>'Add',
                'class'=>'btn btn-success'
            ]) . ' '.
            Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], [
                'class' => 'btn btn-default',
                'title' => 'Reset Grid'
            ]),
            'options' => ['class' => 'btn-group-sm']
        ],
        '{export}',
        '{toggleData}'
    ],
   'toggleDataContainer' => ['class' => 'btn-group-sm'],        
   'panel' => [
      'heading'=>'<h3 class="panel-title"><i class="glyphicon glyphicon-globe"></i> Servers</h3>',
      'type'=>'success',
      'footer'=>true
    ],
    'showPageSummary'=>true,
]);

最佳答案

  • koko 发布于 2015-07-08 15:06 举报

    在xxxSearch.php中设置

    $dataProvider = new ActiveDataProvider([
        'query' => $query,
        'pagination' => [
            'pageSize' => 20,//要多少写多少吧
        ],
    ]);
    
    1 条回复
    回复于 2015-07-09 09:41 回复

    谢谢你,之前是我写错了。这样是可以的。

    觉得很赞
您需要登录后才可以回答。登录 | 立即注册
jsjsd
实习生

jsjsd

注册时间:2015-07-08
最后登录:2015-08-03
在线时长:1小时38分
  • 粉丝0
  • 金钱2
  • 威望0
  • 积分12

热门问题