I try to use from kartik-v: yii2-export (with the module grid)
Did not get to do the export setting (put delimiter, create your own name for the file);
On site:
written default settings:
"The default exportConfig is setup as below".
For their changes I write settings in a property: exportConfig in GridView.
No results are not present, the file is exported with the default settings. And the property itself "exportConfig" successfully parsed like widget GridView, by parseExportConfig.
Since I am suffering for about a day with this, I decided to tweak these settings, the "default", but it does not give (. Settings loaded unclear from where ((
use yii\helpers\Html;
use kartik\grid\GridView;
use kartik\export\ExportMenu;
$gridColumns = [
['class' => 'yii\grid\SerialColumn'],
'idproduct',
'name',
'mainImg',
['class' => 'yii\grid\ActionColumn'],
];
// Renders a export dropdown menu
echo ExportMenu::widget([
'dataProvider' => $dataProvider,
'columns' => $gridColumns
]);
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => $gridColumns,
'exportConfig'=> [
GridView::CSV=>[
'label' => 'CSV',
'icon' => '',
'iconOptions' => '',
'showHeader' => false,
'showPageSummary' => false,
'showFooter' => false,
'showCaption' => false,
'filename' => 'yii',
'alertMsg' => 'created',
'options' => ['title' => 'Semicolon - Separated Values'],
'mime' => 'application/csv',
'config' => [
'colDelimiter' => ";",
'rowDelimiter' => "\r\n",
],
],
],
]);