Answer the question
In order to leave comments, you need to log in
Yii2 dataProvider pagination not setting limit?
Made for myself a custom GridView widget with gadgets.
This is how the limit is set in the controller in the debug logs, it is visible that the request passed with a limit of 300
$query = Stat::find();
$dataProvider = new \yii\data\ActiveDataProvider([
'query' =>$query ,
]);
$dataProvider->pagination->pageSize = 300;
public function __construct($config = []){
if(isset($config['dataProvider'])){
$config['dataProvider']->pagination->pageSize = 500;
}
parent::__construct($config);
}
Answer the question
In order to leave comments, you need to log in
Try to do this not in the constructor, but in the init() method by accessing the dataProvider field. It works for me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question