@@ -109,6 +109,50 @@ use unclead\multipleinput\MultipleInput;
109
109
```
110
110
See more in [ multiple columns] ( https://github.com/unclead/yii2-multiple-input/wiki/Usage#multiple-columns )
111
111
112
+ ### Clone filled rows
113
+ ![ Clone button example] ( https://raw.githubusercontent.com/unclead/yii2-multiple-input/master/resources/images/clone-button.gif )
114
+ ``` php
115
+ use unclead\multipleinput\MultipleInput;
116
+
117
+ ...
118
+
119
+ <?= $form->field($model, 'products')->widget(MultipleInput::className(), [
120
+ 'max' => 10,
121
+ 'cloneButton' => true,
122
+ 'columns' => [
123
+ [
124
+ 'name' => 'product_id',
125
+ 'type' => 'dropDownList',
126
+ 'title' => 'Special Products',
127
+ 'defaultValue' => 1,
128
+ 'items' => [
129
+ 1 => 'id: 1, price: $19.99, title: product1',
130
+ 2 => 'id: 2, price: $29.99, title: product2',
131
+ 3 => 'id: 3, price: $39.99, title: product3',
132
+ 4 => 'id: 4, price: $49.99, title: product4',
133
+ 5 => 'id: 5, price: $59.99, title: product5',
134
+ ],
135
+ ],
136
+ [
137
+ 'name' => 'time',
138
+ 'type' => DateTimePicker::className(),
139
+ 'title' => 'due date',
140
+ 'defaultValue' => date('d-m-Y h:i')
141
+ ],
142
+ [
143
+ 'name' => 'count',
144
+ 'title' => 'Count',
145
+ 'defaultValue' => 1,
146
+ 'enableError' => true,
147
+ 'options' => [
148
+ 'type' => 'number',
149
+ 'class' => 'input-priority',
150
+ ]
151
+ ]
152
+ ]
153
+ ])->label(false);
154
+ ```
155
+
112
156
## Documentation
113
157
114
158
You can find a full version of documentation in [ wiki] ( https://github.com/unclead/yii2-multiple-input/wiki/ )
0 commit comments