1

I've been searching all over but couldn't find a way to display the pagination links like this:

enter image description here

on the grid view.

I have this configuration for my grid:

<?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'),
    ),
));
?>

Anyone who has an idea how to achieve this?

TIA

JohnnyQ
  • 4,839
  • 6
  • 47
  • 65

2 Answers2

1

Just fix your template line like this

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

to

....
   'summaryText'=>'Displaying {start}-{end} of {count} results.',
    'dataProvider' => $dataProvider,
    'template' => "{items}{pager}",
....
Manquer
  • 7,390
  • 8
  • 42
  • 69
0

i have a similar issue, for me the summery text is not showing

my code is

$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',
                        ),

                ),
));
Aswanth
  • 220
  • 1
  • 10