2 Datagrids On The Page And Pagination

I have 2 data grids on one page and when I click on pagination "next" link it switches both grids to the next page.

What is the easiest way to make them work independently?

You have to set pageParam and sortParam of the pager and sorter classes of the dataprovider.

http://www.yiiframework.com/doc-2.0/yii-data-sort.html#$sortParam-detail

http://www.yiiframework.com/doc-2.0/yii-data-pagination.html#$pageParam-detail

This is really useful info.

Added it to the guide: https://github.com/yiisoft/yii2/blob/master/docs/guide/output-data-widgets.md#multiple-gridviews-on-one-page

Great.

Thanks, works well.