Yii Framework Forum: Pagination in Cgridview not resetting when page revisited - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Pagination in Cgridview not resetting when page revisited Rate Topic: -----

#1 User is offline   CodeLoader 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 27-October 16

Posted 28 March 2017 - 06:56 AM

On my application when a user access a page with pagination if select the second page and move to another page and return back via the menu it stays at the second page not returning to the first page.

here's the model

 
 public function search()
    {

        $criteria = new CDbCriteria;
        /*All the criteria conditions to gather the data..*/
 return new CActiveDataProvider($this, array(
            'criteria' => $criteria,
            'sort' => $sort,
            'pagination' => array('pageSize' =>5),
        ));

The view

<?php $this->widget('booster.widgets.TbGridView', array(
    'id' => 'sales-activity-grid',
    'htmlOptions' => array('class' => 'grid-view hand-select-grid'),
    'type' => 'striped bordered condensed',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
'id',
'name'
 array(
            'class' => 'booster.widgets.TbButtonColumn',
            'buttons' => array(
                'view' => array(
                    'visible' => 'true',
                ),
                'update' => array(
                    'visible' => 'true',
                ),
                'delete' => array(
                    'visible' => 'true',
                ),
            ),
        ),


Is there a way to reset the pagination?

Thanks
0

#2 User is offline   reykel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 67
  • Joined: 21-June 15
  • Location:Camaguey, Cuba

Posted 07 April 2017 - 07:29 PM

You're not using ajax, take a look at your url and you'll see the page parameter...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users