Yii2 kartik GridView工作不正确

时间:2015-01-28 04:09:46

标签: php yii2-advanced-app

我已将小部件调整为:

> import kartik / grid / GridView

{{ use('kartik/grid/GridView') }}

>使用GridView :: widget(...)

{{
    grid_view_widget(
        {
            'dataProvider': dataProvider,
            'export': false,
            'responsive': true,
            'condensed': true,
            'toolbar': [
                '{export}',
                '{toggleData}'
            ]
        }
    )
}}

但桌子被剪切,工具栏未显示: picture

1 个答案:

答案 0 :(得分:0)

尝试

GridView::widget([
'dataProvider' => $dataProvider,
'columns' => $columns,
'pjax' => true,
'condensed' => true,
'panel' => [
    'heading' => '<h3 class="panel-title">' . $this->title,
    'before' => Html::a('<i class="glyphicon glyphicon-plus"></i>', ['create'],
            ['class' => 'btn btn-success']) . ' ' .
        Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-info']),
],
'export' => false,
'toolbar' => [     
    '{toggleData}'
]])

使用此至少您的工具栏将会显示。让我知道发生什么事。 :)