public function initExport()
{
$this->_provider = clone $this->dataProvider;
if ($this->batchSize && $this->_provider->pagination) {
$this->_provider->pagination = clone $this->dataProvider->pagination;
$this->_provider->pagination->pageSize = $this->batchSize;
} else {
$this->_provider->pagination = false;
}
if ($this->initProvider) {
$this->_provider->prepare(true);
}
$this->styleOptions = ArrayHelper::merge($this->_defaultStyleOptions, $this->styleOptions);
$this->filterModel = null;
$this->setDefaultExportConfig();
$this->exportConfig = ArrayHelper::merge($this->_defaultExportConfig, $this->exportConfig);
if (empty($this->filename)) {
$this->filename = Yii::t('kvexport', 'grid-export');
}
$target = $this->target == self::TARGET_POPUP ? 'kvExportFullDialog' : $this->target;
$id = ArrayHelper::getValue($this->exportFormOptions, 'id', $this->options['id'] . '-form');
Html::addCssClass($this->exportFormOptions, 'kv-export-full-form');
$this->exportFormOptions += ['id' => $id, 'target' => $target];
}