mirror of https://github.com/artf/grapesjs.git
4 changed files with 75 additions and 1 deletions
@ -0,0 +1,72 @@ |
|||||
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> |
||||
|
|
||||
|
## PropertySelect |
||||
|
|
||||
|
**Extends Property** |
||||
|
|
||||
|
### Properties |
||||
|
|
||||
|
* `options` **[Array][1]<[Object][2]>** Array of option definitions, eg `[{ id: '100', label: 'Set 100' }]` |
||||
|
|
||||
|
### getOptions |
||||
|
|
||||
|
Get available options. |
||||
|
|
||||
|
Returns **[Array][1]<[Object][2]>** Array of options |
||||
|
|
||||
|
### getOption |
||||
|
|
||||
|
Get current selected option or by id. |
||||
|
|
||||
|
#### Parameters |
||||
|
|
||||
|
* `id` **[String][3]** Option id. |
||||
|
|
||||
|
Returns **([Object][2] | null)** |
||||
|
|
||||
|
### setOptions |
||||
|
|
||||
|
Update options. |
||||
|
|
||||
|
#### Parameters |
||||
|
|
||||
|
* `value` **[Array][1]<[Object][2]>** New array of options, eg. `[{ id: 'val-1', label: 'Value 1' }]` (optional, default `[]`) |
||||
|
|
||||
|
### addOption |
||||
|
|
||||
|
Add new option. |
||||
|
|
||||
|
#### Parameters |
||||
|
|
||||
|
* `value` **[Object][2]** Option object, eg. `{ id: 'val-1', label: 'Value 1' }` |
||||
|
|
||||
|
### getOptionId |
||||
|
|
||||
|
Get the option id from the option object. |
||||
|
|
||||
|
#### Parameters |
||||
|
|
||||
|
* `option` **[Object][2]** Option object |
||||
|
|
||||
|
Returns **[String][3]** Option id |
||||
|
|
||||
|
### getOptionLabel |
||||
|
|
||||
|
Get option label. |
||||
|
|
||||
|
#### Parameters |
||||
|
|
||||
|
* `id` **[String][3]** Option id |
||||
|
* `opts` **[Object][2]** Options (optional, default `{}`) |
||||
|
|
||||
|
* `opts.locale` **[Boolean][4]** Use the locale string from i18n module (optional, default `true`) |
||||
|
|
||||
|
Returns **[String][3]** Option label |
||||
|
|
||||
|
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array |
||||
|
|
||||
|
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object |
||||
|
|
||||
|
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String |
||||
|
|
||||
|
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean |
||||
Loading…
Reference in new issue