File tree Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,21 @@ Each column in a row can has their own type. Widget supports:
122
122
- ` radioList `
123
123
- ` textarea `
124
124
- 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
+ ```
125
140
126
141
### JavaScript events
127
142
This widget has following events:
Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ class ExampleModel extends Model
19
19
20
20
$this->schedule = [
21
21
[
22
- 'day' => 0 ,
22
+ 'day' => '27.02.2015' ,
23
23
'user_id' => 1,
24
24
'priority' => 1
25
25
],
26
26
[
27
- 'day' => 0 ,
27
+ 'day' => '27.02.2015' ,
28
28
'user_id' => 2,
29
29
'priority' => 2
30
30
],
@@ -67,18 +67,20 @@ use yii\helpers\Html;
67
67
],
68
68
[
69
69
'name' => 'day',
70
- 'type' => 'dropDownList' ,
70
+ 'type' => \kartik\date\DatePicker::className() ,
71
71
'title' => 'Day',
72
72
'value' => function($data) {
73
73
return $data['day'];
74
74
},
75
- 'defaultValue' => 1,
76
75
'items' => [
77
76
'0' => 'Saturday',
78
77
'1' => 'Monday'
79
78
],
80
79
'options' => [
81
-
80
+ 'pluginOptions' => [
81
+ 'format' => 'dd.mm.yyyy',
82
+ 'todayHighlight' => true
83
+ ]
82
84
]
83
85
],
84
86
[
You can’t perform that action at this time.
0 commit comments