F
F
Finsh2015-12-21 15:37:58
Yii
Finsh, 2015-12-21 15:37:58

Yii2 How to add Editable to GridView?

Yii reports that:
Object of class kartik\editable\Editable could not be converted to string
The element of the columns array where I include the file to edit

[
            // Комментарий о клиенте
            'header' => Yii::t('views/langAdvancing', 'Comment'),
            'format' => 'raw',
            'value' => function ($mod) {
                $comments = $mod->fkDClient->getCRecalls();
                $model = new \common\models\ClientRecall();
                return Yii::$app->controller->renderPartial('_editComment', [
                    'comment' => $comments['cr_comment'],
                    'model' => $model,
                ]);
            }
        ],

Directly connected view in which I register the widget
use kartik\editable\Editable;
use yii\helpers\Html;

echo Editable::begin([
    'model'=>$model,
    'attribute' => 'cr_mark',
    'size' => 'md',
    'format' => 'button',
    'editableValueOptions'=>['class'=>'well well-sm']
]);

What could be the problem here? I will be extremely grateful for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Pavlenko, 2015-12-21
@Akdmeh

If Editable::begin needs another editable::end then whatever is inside will be passed to the widget.
And if you need to call the widget:
echo Editable::widget()... , then you will get exactly the output of the widget.
//this is the first error i noticed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question