Skip to content

Commit 422403f

Browse files
author
Igor Chepurnoy
authored
Update README.md
1 parent d69e316 commit 422403f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,32 @@ to the require section of your composer.json.
2828
Usage Editable column
2929
---------------------------------------
3030
1) In your gridview columns section
31+
32+
**Text column:**
3133
```php
3234
[
3335
'class' => EditableColumn::className(),
3436
'attribute' => 'username',
3537
'url' => ['change-username'],
3638
],
3739
```
40+
**Select column:**
41+
```php
42+
[
43+
'class' => EditableColumn::className(),
44+
'attribute' => 'status',
45+
'url' => ['change-username'],
46+
'type' => 'select',
47+
'editableOptions' => function ($model) {
48+
return [
49+
'source' => [1 => 'Active', 2 => 'Deleted'],
50+
'value' => $model->status,
51+
];
52+
},
53+
],
54+
```
55+
> Allowed column types: text, select, address, combodate, date, datetime
56+
3857
2) And add to your controller
3958
```php
4059
public function actions()

0 commit comments

Comments
 (0)