I use Yii2 Gridview (kartik-v/yii2-grid) with ArrayDataProvider. First columns are grouped using the 'group' => true directive. I would like to use pagination but also to keep grouped entries in the same page. The default way of Yii2 ArrayDataProvider pagination cannot make any difference and split grouped entries across subsequent pages. Is there any proposal in order for me to control pagination somehow?
Asked
Active
Viewed 333 times
1 Answers
0
GridView will always display rows returned by getModels()
method of data provider.
The only way to control what rows are displayed is to implement own data provider. For example you can extend yii\data\ArrayDataProvider
and override its implementation of getModels()
method.

Michal Hynčica
- 5,038
- 1
- 12
- 24