You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$dataProvider = newActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => 20,
]
]);
// Add some data to the dataProvider$models = $dataProvider->getModels();
foreach ($modelsas$key => $model) {
$models[$key]['saleTicket'] = SaleTicket::findOne($model['id']);
}
$dataProvider->setModels($models);
In the view file I successfuly use $model['saleTicket'] data in the Yii-Grid at any page (using pagination).
But in the Yii-Export this additional $model['saleTicket']available only at the "first page" of the export with batchSize. After first batch I've got only "query" data.
I don't think this is a problem with yii2-export, but rather with your approach - in that foreach loop in the first block, you only set saleTicket for the models initially loaded by $dataProvider, which are the first 20 models (due to its pagination). You never set the values for any models loaded afterwards, so they don't have them.
I have an ActiveDataProvider
In the view file I successfuly use
$model['saleTicket']
data in the Yii-Grid at any page (using pagination).But in the Yii-Export this additional
$model['saleTicket']
available only at the "first page" of the export with batchSize. After first batch I've got only "query" data.Expected behavior
All data should be available at the export with
batchSize
.The text was updated successfully, but these errors were encountered: