I'm trying to change the amount of rows shown on the gridView (Yii2) but I couldn't find anything in their documentation.
Is it even possible or do I have to have to use another extension? (Kartik for example.)
Also, is it possible to remove "Showing x of x items" as shown beneath?
To change the number of items displayed per page, you need to set pagination
in your data provider.
Example:
$dataProvider = new ActiveDataProvider([
...
'pagination' => [
'pageSize' => 10,
],
]);
As for removing information about displayed items you need to remove summary
from layout
:
<?= GridView::widget([
...
'layout' => "{items}\n{pager}",
]) ?>
Official docs:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With