7

当我拉入 kartik 可扩展行网格时,使用 pjax 未应用可编辑列样式。我该怎么做才能将 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']
                        ]
                    ]
                ],
4

1 回答 1

0

也许您应该尝试使用可编辑选项中的 containerOptions 或 contentOptions 属性设置 HTML。

于 2017-10-27T12:26:21.800 回答