Kartik网格可编辑列与expandrow样式不适用

时间:2017-10-13 21:44:06

标签: yii kartik-v

当我使用pjax拉入kartik可扩展行网格时,未应用editablecolumn样式。如何将css应用于此列?

<?php echo GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'pjax' => false,
        'columns' => [
            [
                'class' => 'kartik\grid\ExpandRowColumn',
                'value' => function ($model, $key, $index, $column){
                    return GridView::ROW_COLLAPSED;
                },
                'detailUrl' => 'index.php?r=controller/detail'
            ],

扩展视图

<?php echo GridView::widget([
            'dataProvider' => $dataProvider,
            'pjax'=> true,
            'columns' => [
                [
                    'attribute' => 'brand_name',
                    'value' => function($model,$key,$idx,$col){
                            return $model['brand_name'];
                        },
                ],
                [
                    'class'=>'kartik\grid\EditableColumn',
                    'hAlign'=>'center',
                    'vAlign'=>'middle',
                    'value' => function($model,$key,$idx,$col){
                            return 100;
                        },
                    'editableOptions' => [
                        'name' => 'Test',
                        'header' => 'Test22',
                        'inputType' => Editable::INPUT_TEXT,
                        'formOptions' => ['action' => ['/book/editbook']],
                        'options' => [
                            'convertFormat'=>true, 
                            'pluginOptions' => ['format' => 'php:Y-m-d']
                        ]
                    ]
                ],

1 个答案:

答案 0 :(得分:0)

也许您应该尝试使用editableOptions中的containerOptions或contentOptions属性设置HTML。