RMP_Section
new RMP_Section(conf)
This constructor allows you to create a section widget that can be inserted dynamically in your web interface.
** Parameters:**
| Name | Type | Description |
|---|---|---|
| conf | Object | JSON structure which contains the configuration of the section |
Example
var conf = {"id":"id_section","label":"Section label","open":true};
var section= new RMP_Section(conf);
id_of_a_widget.insertAbove(section);
id_section.setOnOpenScript(()=> {console.log('opened')})
Methods
close()
Closes the section.
getType() → {string}
Returns the type of the widget (RMP_Section).
Returns: string
isOpen() → {string}
Returns true if the section is opened, otherwise false.
Returns: string
open()
Opens the section.
setOnCloseScript(callBk)
Sets a callback function to handle the "on section closed" script field of a section widget.
Parameters:
| Name | Type | Description |
|---|---|---|
| callBk | module:RMP_Section~callbackFunction | Callback that handles the "on section closed" script. |
setOnOpenScript(callBk)
Sets a callback function to handle the "on section opened" script field of a section widget.
Parameters:
| Name | Type | Description |
|---|---|---|
| callBk | module:RMP_Section~callbackFunction | Callback that handles the "on section opened" script. |
Type Definitions
callbackFunction()
Callback function to execute the onOpen/onClose script field of a section widget.