In kartik's EditableColumn, editableValue passed is always 'Null'

17 Views Asked by At

I tried to edit gridView with kartik-v extension's editable column. But my view is always submiting null value to the controller. I checked controller with static value and it is properly worked.

This is my view.

<?= \kartik\grid\GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],
        'id',
        'timeSlot',
        'meterReading',
        [
            'class' => EditableColumn::class,
            'attribute' => 'production',
            'editableOptions' => [
                'header' => 'Production',
                'format' => Editable::FORMAT_LINK,
                'inputType' => Editable::INPUT_TEXT,
                'editableValueOptions'=>['type'=>'number'],
                'formOptions' => [
                    'action' => Url::to(['b-mproduct-summary/update-grid']),
                ],
            ],
        ],
    ]
    [
            'class' => ActionColumn::className(),
            'urlCreator' => function ($action, BMproductSummary $model, $key, $index, $column) {
                return Url::toRoute([$action, 'id' => $model->id]);
            }
        ],
    ],
]); ?>

But the controller gets, (according to debug)

[
    'id' => '1',
    'attribute' => 'damage',
    'value' => null,
]

What would be the reason for not submitting 'editableValue'.

0

There are 0 best solutions below