0

How to hide some formats from export menu in DynaGrid. I was tried settings for GridView widget but doesn't work. Formats are still visible.

'exportConfig' => [
    GridView::CSV => ['label' => 'Save as CSV'],
    GridView::HTML => [],
    GridView::PDF => [],
]
solinskip
  • 11
  • 1

1 Answers1

1

You need to use the above option exportConfig under the gridOptions and you should specify only those formats that you want to be visible once the dropdown opens, if you want only the CSV format then just provide the CSV option under the exportConfig

echo DynaGrid::widget([
    'columns' => $columns,
    'storage' => DynaGrid::TYPE_COOKIE,
    'theme' => 'panel-danger',
    'gridOptions' => [
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'exportConfig'=>[
            GridView::CSV=>['label'=>'Save As'],
        ],    
        'panel' => ['heading' => '<h3 class="panel-title">Library</h3>'],

    ],

    'options' => ['id' => 'dynagrid-1'], // a unique identifier is important
]);
Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68