Floating Page Size In Cgridview

I use CGridView for three different pages. For two of them - no problem, i use pageSize=50 and each page is displayed with correct number of records.

For last page - all badly.

I set constant pageSize too, but on different pages count of records can be completely random.

For example (pageSize everywhere in examples is 30):

1 page - 1-30,

2 page - 31-58, (why two less??)

3 page - 61-90.

Another example:

1 page - 1-24,

2 page - 31-44,

3 page - 61-69,

4 page - 91-102.

Please help me understand, what is the problem??

Any HAS_MANY relations in the grid data?

Yes, it has HAS_MANY and MANY_MANY.

Check this https://github.com/yiisoft/yii/issues/2360

Huge thanks, you saved me a lot of time!

I solved my problem by adding “$criteria->group = ‘t.id’” to model.

Glad I could help.