phpgridviewyiipaginationyii-booster

How to display pagination links below TbExtendedGridView in YiiBooster?


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


Solution

  • 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}",
    ....