1

我一直在搜索,但找不到像这样显示分页链接的方法:

在此处输入图像描述

在网格视图上。

我的网格有这个配置:

<?php
$dataProvider=$model->search();
$dataProvider->pagination = array('pageSize'=>1); // Forced to show 1 item per page to make sure the pagination is triggered.
$widget = $this->widget('bootstrap.widgets.TbExtendedGridView', array(
  'id'=>'_grid',
  // 'filter'=>new CallReport,
  'fixedHeader' => true,
  'responsiveTable' => true,
  'headerOffset' => 30, // 40px is the height of the main navigation at bootstrap
  'selectableRows'=>1,
  'selectionChanged'=>'function(id){ 
    if ( $.fn.yiiGridView.getSelection(id).length ) {
      $("#selectBtnID").fadeIn("fast");
    } else {
      $("#selectBtnID").fadeOut("fast");
    }
  }',
  'afterAjaxUpdate'=>'function(id){ 
    if ( $.fn.yiiGridView.getSelection(id).length ) {
      $("#selectBtnID").fadeIn("fast");
    } else {
      $("#selectBtnID").fadeOut("fast");
    }
  }',
  'type'=>'striped bordered',
  'enablePagination' => true,
  'pager' => array(
        'cssFile' => false,
        'header' => false,
        'firstPageLabel' => 'First',
        'prevPageLabel' => 'Previous',
        'nextPageLabel' => 'Next',
        'lastPageLabel' => 'Last',
    ),
  'summaryText'=>'Displaying {start}-{end} of {count} results.',
  'dataProvider' => $dataProvider,
  'template' => "{items}",
  'columns' => array(
            array('name' => 'call_date','header' => 'Call Date'),
            array('name'=>'remarks', 'header'=>'Remarks'),
            array('name'=>'appointment_date', 'header'=>'Appointment Date'),
            array('name'=>'appointment_venue', 'header'=>'Appointment Venue'),
            array('name'=>'appointment_remarks', 'header'=>'Appointment Remarks'),
            array('name'=>'issues_concern', 'header'=>'Issues/Concern'),
            array('name'=>'supervisor_message', 'header'=>'Supervisor Message'),
    ),
));
?>

谁知道如何实现这一目标?

TIA

4

2 回答 2

1

只需像这样修复您的模板行

....
    'summaryText'=>'Displaying {start}-{end} of {count} results.',
    'dataProvider' => $dataProvider,
    'template' => "{items}",
....

....
   'summaryText'=>'Displaying {start}-{end} of {count} results.',
    'dataProvider' => $dataProvider,
    'template' => "{items}{pager}",
....
于 2014-06-21T17:27:27.727 回答
0

我有一个类似的问题,对我来说,夏季文字没有显示

我的代码是

$this->widget('booster.widgets.TbExtendedGridView',
        array(
                'type' => 'striped',
                'dataProvider' => $dataprovider,
                'responsiveTable' => true,
                'summaryText'=>'Displaying {start}-{end} of {count} results.',
                'template' => "{items}{pager}",             
                'columns' => array(
                        array(
                                'header'=>'Title',
                                'value'=>'$data->qtitle',
                        ),
                        array(
                                'header'=>'Url',
                                'type'=>'raw',
                                'value'=>'$data->qurl',
                ),
                array(
                        'header'=>'Attachments',
                        'type'=>'html',
                        'value'=>function($data) {
                            $arr=json_decode($data->attachments);
                            if(count($arr)<1) return "No Attachments";
                            else{
                                $value=Files::model()->getfileurls($arr);   
                            }

                            return $value;
                        },
                        ),
                array(
                    'header'=>'Submited On',
                    'value'=>'$data->submitedon',
                        ),

                ),
));
于 2014-11-21T10:35:26.257 回答