mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-28 10:20:08 +02:00
Documentation
This commit is contained in:
parent
bda230ef46
commit
977c946d2a
12
README.md
12
README.md
|
@ -299,6 +299,17 @@ const example = new Choices(element, {
|
||||||
|
|
||||||
**Usage:** The value of the inputs placeholder.
|
**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
|
### prependValue
|
||||||
**Type:** `String` **Default:** `null`
|
**Type:** `String` **Default:** `null`
|
||||||
|
|
||||||
|
@ -671,6 +682,7 @@ const example = new Choices(element, {
|
||||||
{value: 'One', label: 'Label One'},
|
{value: 'One', label: 'Label One'},
|
||||||
{value: 'Two', label: 'Label Two', disabled: true},
|
{value: 'Two', label: 'Label Two', disabled: true},
|
||||||
{value: 'Three', label: 'Label Three'},
|
{value: 'Three', label: 'Label Three'},
|
||||||
|
{value: '', label: 'Choose a number...', placeholder: true},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -390,9 +390,7 @@
|
||||||
{value: 'Six', label: 'Label Six', selected: true},
|
{value: 'Six', label: 'Label Six', selected: true},
|
||||||
], 'value', 'label', false);
|
], 'value', 'label', false);
|
||||||
|
|
||||||
var singlePresetOpts = new Choices('#choices-single-preset-options', {
|
var singlePresetOpts = new Choices('#choices-single-preset-options').setChoices([{
|
||||||
placeholder: true,
|
|
||||||
}).setChoices([{
|
|
||||||
label: 'Group one',
|
label: 'Group one',
|
||||||
id: 1,
|
id: 1,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
@ -426,8 +424,6 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
var singlePlaceholderOption = new Choices('#choices-placeholder-option', {
|
var singlePlaceholderOption = new Choices('#choices-placeholder-option', {
|
||||||
placeholder: true,
|
|
||||||
placeholderValue: 'Please Choose…',
|
|
||||||
removeItemButton: false,
|
removeItemButton: false,
|
||||||
preselectItem: false,
|
preselectItem: false,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue