Documentation

This commit is contained in:
Josh Johnson 2017-01-23 14:33:51 +00:00
parent bda230ef46
commit 977c946d2a
2 changed files with 13 additions and 5 deletions

View file

@ -299,6 +299,17 @@ const example = new Choices(element, {
**Usage:** The value of the inputs placeholder.
**Note:** To assign a placeholder to a single select box, assign a `placeholder` attribute to an option. For example:
```html
<select>
<option selected placeholder>This will appear like a placeholder</option>
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
</select>
```
### prependValue
**Type:** `String` **Default:** `null`
@ -671,6 +682,7 @@ const example = new Choices(element, {
{value: 'One', label: 'Label One'},
{value: 'Two', label: 'Label Two', disabled: true},
{value: 'Three', label: 'Label Three'},
{value: '', label: 'Choose a number...', placeholder: true},
],
});

View file

@ -390,9 +390,7 @@
{value: 'Six', label: 'Label Six', selected: true},
], 'value', 'label', false);
var singlePresetOpts = new Choices('#choices-single-preset-options', {
placeholder: true,
}).setChoices([{
var singlePresetOpts = new Choices('#choices-single-preset-options').setChoices([{
label: 'Group one',
id: 1,
disabled: false,
@ -426,8 +424,6 @@
});
var singlePlaceholderOption = new Choices('#choices-placeholder-option', {
placeholder: true,
placeholderValue: 'Please Choose…',
removeItemButton: false,
preselectItem: false,
});