Every Yii2 widget has so much encapsulated in it that using multiple GridView widgets is a simple activity that involves making few changes.
The only parameters indeed that are not customizable with the DataProvider model class are
sortParam, which define the current page index and the parameters used to order a grid.
Suppose, for example, that we have two GridViews filled with two different data providers,
In the controller, we will set the
sortParam parameters of each DataProvider:
$firstDataProvider->pagination->pageParam = 'first-dp-page'; $firstDataProvider->sort->sortParam = 'first-dp-sort'; $secondDataProvider->pagination->pageParam = 'second-dp-page'; ...