File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,64 @@ use unclead\multipleinput\MultipleInput;
50
50
->label(false);
51
51
?>
52
52
```
53
+ See more in [ single column] ( https://github.com/unclead/yii2-multiple-input/wiki/Usage#one-column )
54
+
55
+ ## Advanced usage
56
+
57
+ ![ Multiple columns example] ( https://raw.githubusercontent.com/unclead/yii2-multiple-input/master/resources/images/multiple-column.gif )
58
+
59
+ For example you want to have an interface for manage user schedule. For simplicity we will store the schedule in json string.
60
+ In this case you can use yii2-multiple-input widget like in the following code
61
+
62
+ ``` php
63
+ use unclead\multipleinput\MultipleInput;
64
+
65
+ ...
66
+
67
+ <?= $form->field($model, 'schedule')->widget(MultipleInput::className(), [
68
+ 'max' => 4,
69
+ 'columns' => [
70
+ [
71
+ 'name' => 'user_id',
72
+ 'type' => 'dropDownList',
73
+ 'title' => 'User',
74
+ 'defaultValue' => 1,
75
+ 'items' => [
76
+ 1 => 'User 1',
77
+ 2 => 'User 2'
78
+ ]
79
+ ],
80
+ [
81
+ 'name' => 'day',
82
+ 'type' => \kartik\date\DatePicker::className(),
83
+ 'title' => 'Day',
84
+ 'value' => function($data) {
85
+ return $data['day'];
86
+ },
87
+ 'items' => [
88
+ '0' => 'Saturday',
89
+ '1' => 'Monday'
90
+ ],
91
+ 'options' => [
92
+ 'pluginOptions' => [
93
+ 'format' => 'dd.mm.yyyy',
94
+ 'todayHighlight' => true
95
+ ]
96
+ ]
97
+ ],
98
+ [
99
+ 'name' => 'priority',
100
+ 'title' => 'Priority',
101
+ 'enableError' => true,
102
+ 'options' => [
103
+ 'class' => 'input-priority'
104
+ ]
105
+ ]
106
+ ]
107
+ ]);
108
+ ?>
109
+ ```
110
+ See more in [ multiple columns] ( https://github.com/unclead/yii2-multiple-input/wiki/Usage#multiple-columns )
53
111
54
112
## Documentation
55
113
You can’t perform that action at this time.
0 commit comments