urmaul / yii-selectcolumn
SelectColumn for Yii CGridView.
v1.0.1
2014-11-19 16:59 UTC
Requires
- yiisoft/yii: *
This package is not auto-updated.
Last update: 2024-12-21 17:27:49 UTC
README
SelectColumn for Yii CGridView. It replaces cell content with label from map. And it sets that map as dropdown filter.
Installing
composer require urmaul/yii-selectcolumn dev-master
Using
First, add this line to imports config:
'import'=>array( ... 'SelectColumn', ... ),
Using with enum attributes
Works great with EnumAttributes behavior.
array( 'class' => 'SelectColumn', 'name' => 'status', 'labels' => $model->statusEnum->valueLabels, ),
Using with relations
Works great with ListData behavior.
array( 'class' => 'SelectColumn', 'name' => 'category_id', 'labels' => Category::model()->listData, ),