蛋黄派 2015-03-04 14:29:03 8119次浏览 3条评论 5 0 0
use kartik\export\ExportMenu;

$gridColumns = [

];
echo GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => $gridColumns,
]).ExportMenu::widget([
    'dataProvider' => $dataProvider,
    'columns' => $gridColumns,
    'columnSelectorOptions'=>[
       'label' => 'Cols...',
       'class' => 'btn btn-default creatActive'

    ],
    'hiddenColumns'=>[0, 8], // SerialColumn & ActionColumn
    'disabledColumns'=>[1, 2,], // ID & Name
    'fontAwesome' => true,
    'dropdownOptions' => [
       'label' => 'Export All',
       'class' => 'btn btn-default creatActive'
    ]
]). "<hr>\n";
?>
您需要登录后才可以评论。登录 | 立即注册