Skip to content

Commit f501041

Browse files
author
Eugene Tupikov
committed
Update widget column type documentation
1 parent ab0ed2a commit f501041

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,21 @@ Each column in a row can has their own type. Widget supports:
122122
- `radioList`
123123
- `textarea`
124124
- For more detail look at [Html helper class](http://www.yiiframework.com/doc-2.0/yii-helpers-html.html)
125+
- input widget (widget that extends from `InputWidget` class). For example, `yii\widgets\MaskedInput`
126+
127+
For using widget as column input you may use the following code:
128+
129+
```php
130+
[
131+
'name' => 'phone',
132+
'title' => 'Phone number',
133+
'type' => \yii\widgets\MaskedInput::className(),
134+
'options' => [
135+
'class' => 'input-phone',
136+
'mask' => '999-999-99-99'
137+
]
138+
]
139+
```
125140

126141
### JavaScript events
127142
This widget has following events:

docs/images/multiple-column.gif

306 KB
Loading

docs/multiple_columns.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class ExampleModel extends Model
1919

2020
$this->schedule = [
2121
[
22-
'day' => 0,
22+
'day' => '27.02.2015',
2323
'user_id' => 1,
2424
'priority' => 1
2525
],
2626
[
27-
'day' => 0,
27+
'day' => '27.02.2015',
2828
'user_id' => 2,
2929
'priority' => 2
3030
],
@@ -67,18 +67,20 @@ use yii\helpers\Html;
6767
],
6868
[
6969
'name' => 'day',
70-
'type' => 'dropDownList',
70+
'type' => \kartik\date\DatePicker::className(),
7171
'title' => 'Day',
7272
'value' => function($data) {
7373
return $data['day'];
7474
},
75-
'defaultValue' => 1,
7675
'items' => [
7776
'0' => 'Saturday',
7877
'1' => 'Monday'
7978
],
8079
'options' => [
81-
80+
'pluginOptions' => [
81+
'format' => 'dd.mm.yyyy',
82+
'todayHighlight' => true
83+
]
8284
]
8385
],
8486
[

0 commit comments

Comments
 (0)