CGridView pagination, problem with items showing up on multiple pages

Hello,

I have a gridview with data, it has defaultorder set to date and pagination set to 20. On some of the pagination pages the last one or two rows from the previous page shows up at the top on the current page. Any ideas on this? Maybe something with the sorting?

In my models search-method:




return new ActiveDataProvider($this, array(

	'criteria'=>$criteria,

	'sort'=>array(

                'defaultOrder'=>array(

      			'date'=>true

    		)

         ),

         'pagination'=>array(

        	'pageSize'=> 20

    	),

));



Try it:

http://new.livetiming.se:8081/octoopen/index.php?r=swimmerHistory/index

Change the first date to 2012-01-01 and then click "sök"

Go to page 3, the two names at the bottom will also show up on page 4 at the top.

Thanks!

It seems your are running on ubuntu, so I would expect that you are using mysql and not MSSQL.

If not, find inspiration in my previous answers:

http://www.yiiframew…772#entry193772

http://www.yiiframew…post__p__225863

Your servers is running IIS and likely also MSSQL - your localhost may be running mysql on your localhost or have a number of records for which the issue does not occur.

Also, if you are filtering on relations, you probably need to have ‘together=true’ in place. Or, I recommend to use my extension: http://www.yiiframework.com/extension/relatedsearchbehavior/ .