public function init()
{
if (empty($this->options['id'])) {
$this->options['id'] = $this->getId();
}
if (empty($this->exportRequestParam)) {
$this->exportRequestParam = 'exportFull_' . $this->options['id'];
}
$this->_columnSelectorEnabled = $this->showColumnSelector && $this->asDropdown;
$this->_triggerDownload = !empty($_POST) && !empty($_POST[$this->exportRequestParam]) && $_POST[$this->exportRequestParam];
$this->_doNotStream = !$this->stream && !$this->streamAfterSave;
if ($this->_doNotStream) {
$this->target = self::TARGET_SELF;
}
if ($this->_triggerDownload) {
if (!$this->_doNotStream) {
Yii::$app->controller->layout = false;
}
$this->_exportType = $_POST[self::PARAM_EXPORT_TYPE];
$this->_columnSelectorEnabled = $_POST[self::PARAM_COLSEL_FLAG];
$this->initSelectedColumns();
}
if ($this->dynagrid) {
$this->_columnSelectorEnabled = false;
$options = $this->dynagridOptions;
$options['columns'] = $this->columns;
$options['storage'] = 'db';
$options['gridOptions']['dataProvider'] = $this->dataProvider;
$dynagrid = new DynaGrid($options);
$this->columns = $dynagrid->getColumns();
}
parent::init();
}