Yii2 Kartik ExpandRowColumn - объединить строку с кнопкой / значком действия для раскрытия - PullRequest
0 голосов
/ 05 мая 2020

Можно ли добавить код в столбец действий для расширения ExpandRowColumn, как с анонимной функцией? Мне нужно добавить в этот столбец итоговые строки в каждом столбце ExpandRowColumn, как показано на следующем рисунке.

enter image description here

пример в expandIcon свойство:

[
    'class' => 'kartik\grid\ExpandRowColumn',
    'width' => '50px',
    'expandIcon' => function ($model, $key, $index, $column) {
        $total = Model::find()->where(['id_model' => $model->id])->count();
        return '<i class="fa fa-plus-square"></i> ' . $total;
    },
    'value' => function ($model, $key, $index, $column) {
        return GridView::ROW_COLLAPSED;
    },
    'detail' => function ($model, $key, $index, $column) {
        return Yii::$app->controller->renderPartial('_expand-row-details', ['model' => $model]);
    },
],
...