Skip to content

Commit

Permalink
added clone button example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Nesterov committed Apr 10, 2018
1 parent f3d1869 commit 3ac3656
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Expand Up @@ -109,6 +109,50 @@ use unclead\multipleinput\MultipleInput;
```
See more in [multiple columns](https://github.com/unclead/yii2-multiple-input/wiki/Usage#multiple-columns)

### Clone filled rows
![Clone button example](https://raw.githubusercontent.com/unclead/yii2-multiple-input/master/resources/images/clone-button.gif)
```php
use unclead\multipleinput\MultipleInput;

...

<?= $form->field($model, 'products')->widget(MultipleInput::className(), [
'max' => 10,
'cloneButton' => true,
'columns' => [
[
'name' => 'product_id',
'type' => 'dropDownList',
'title' => 'Special Products',
'defaultValue' => 1,
'items' => [
1 => 'id: 1, price: $19.99, title: product1',
2 => 'id: 2, price: $29.99, title: product2',
3 => 'id: 3, price: $39.99, title: product3',
4 => 'id: 4, price: $49.99, title: product4',
5 => 'id: 5, price: $59.99, title: product5',
],
],
[
'name' => 'time',
'type' => DateTimePicker::className(),
'title' => 'due date',
'defaultValue' => date('d-m-Y h:i')
],
[
'name' => 'count',
'title' => 'Count',
'defaultValue' => 1,
'enableError' => true,
'options' => [
'type' => 'number',
'class' => 'input-priority',
]
]
]
])->label(false);
```

## Documentation

You can find a full version of documentation in [wiki](https://github.com/unclead/yii2-multiple-input/wiki/)
Expand Down
Binary file added resources/images/clone-button.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3ac3656

Please sign in to comment.