如何从 DynaGrid 的导出菜单中隐藏某些格式。我尝试了 GridView 小部件的设置,但不起作用。格式仍然可见。
'exportConfig' => [
GridView::CSV => ['label' => 'Save as CSV'],
GridView::HTML => [],
GridView::PDF => [],
]
如何从 DynaGrid 的导出菜单中隐藏某些格式。我尝试了 GridView 小部件的设置,但不起作用。格式仍然可见。
'exportConfig' => [
GridView::CSV => ['label' => 'Save as CSV'],
GridView::HTML => [],
GridView::PDF => [],
]
您需要在 下使用上述选项exportConfig
,gridOptions
并且您应该只指定您希望在下拉菜单打开后可见的格式,如果您只需要CSV
格式,则只需CSV
在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
]);