diff --git a/kcadmin/views/category/index.php b/kcadmin/views/category/index.php index 85980f1..32f4079 100644 --- a/kcadmin/views/category/index.php +++ b/kcadmin/views/category/index.php @@ -61,10 +61,11 @@ $this->params['breadcrumbs'][] = $this->title; 'attribute' => 'description', 'enableSorting' => false, 'format' => 'ntext', - 'width' => '49%', + 'width' => '55%', ], [ 'class' => 'blobt\grid\ActionColumn', + 'align' => 'center' ], ], ]); diff --git a/vendor/blobt/grid/DataColumn.php b/vendor/blobt/grid/DataColumn.php index 12511d1..35ac3b1 100644 --- a/vendor/blobt/grid/DataColumn.php +++ b/vendor/blobt/grid/DataColumn.php @@ -175,7 +175,14 @@ class DataColumn extends Column { return call_user_func($this->value, $model, $key, $index, $this); } elseif ($this->attribute !== null) { - return ArrayHelper::getValue($model, $this->attribute); + $val = ArrayHelper::getValue($model, $this->attribute); + if ($this->showConstText) { + $constArrKey = Inflector::variablize($this->attribute, '_'); + if (isset($model::$$constArrKey)) { + $val = $model::$$constArrKey[$val]; + } + } + return $val; } return null;