Skip to content

Commit 585c4d8

Browse files
authored
Merge pull request #209 from alex-nesterov/clonebutton-readme
added clone button example to readme file
2 parents f3d1869 + 3ac3656 commit 585c4d8

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,50 @@ use unclead\multipleinput\MultipleInput;
109109
```
110110
See more in [multiple columns](https://github.com/unclead/yii2-multiple-input/wiki/Usage#multiple-columns)
111111

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+
112156
## Documentation
113157

114158
You can find a full version of documentation in [wiki](https://github.com/unclead/yii2-multiple-input/wiki/)

resources/images/clone-button.gif

216 KB
Loading

0 commit comments

Comments
 (0)