RMP_Array
Array widget
new RMP_Array(conf)
This constructor allows you to create an array widget that can be inserted dynamically in your web interface
Parameters:
| Name | Type | Description |
|---|---|---|
| conf | Object | JSON structure which contains the configuration of the array |
Example
var columnConf = {"id":"id_text","label":{"text":"My label"},"variable":[{"name":"my_variable","value":"foo"}],"js-type":"RMP_TextInput"};
var footerConf = {"js-type":"RMP_Scripter","listen-variables":[{"name":"array.foo"}],"function":{"name":"SUM","parameter":"array.foo"}};
var conf = {"id":"id_array","variable":[{"name":"array"}],"column":[{"header":"Header 1","widget":columnConf,"footer":footerConf}]};
var id_array = new RMP_Array(conf );
id_widget.insertAfter(id_array );
Methods
getColumnsCount()
This function returns the number of columns of an array
getContainerIndex() → {String}
Returns:
The index of the container of the widget, it might be the index of the column if the widget is Tin an array or the index of the tab if it's in a tab panel
Type: String
getElement() → {object}
This function returns the html object of the widget
Returns:
Type: object
getHeader(columnIndex)
This function returns the header value of a given column of the widget array (columnIndex starts at '0')
Parameters:
| Name | Type | Description |
|---|---|---|
| columnIndex | String |
getListOfMyVariables() → {object}
This function returns the list of variables of the widget
Returns: object
Example
["id8.label","id8.value"] for list or ["textvar"] for a text input
getMissingVariableMessage() → {String}
This function returns the message displayed if a mandatory widget's variable is missing
Returns: String
getName() → {String}
This function returns the id as string of the widget
Returns: String
getParent() → {object}
Returns:
The parent widget of a widget
Type: object
getRowsCount()
This function returns the number of rows of an array
getTooltip() → {String}
This function returns the tooltip text of the widget
Returns: String
getType() → {String}
This function returns the type of the widget(RMP_Image, RMP_Html, RMP_Scripter, RMP_StaticTextwidget, RMP_Button, RMP_TextInput, RMP_ListBox, RMP_MultiSelectionCheckBox, RMP_RadioButton, RMP_Array, RMP_FileUpload... )
Returns: String
getValidationVariableMessage() → {String}
This function returns the message displayed if a validation rule is not met
Returns: String
getValue() → {String}
This function returns the value of the widget's variable. It does not work for list's widgets (check box list, radio button list and list) where you should use widgetID.getSelectedValue.
Returns: String
getVariableValue(varName) → {String}
This function returns the value of a given variable of the widget
Parameters:
| Name | Type | Description |
|---|---|---|
| varName | string |
Returns: String
insertAbove(widget)
This function allows you to insert above widgetID, the new widget created thanks to new RMP_xxx() function
Parameters:
| Name | Type | Description |
|---|---|---|
| widget | object | the inserted widget |
insertAfter(widget)
This function allows you to insert on the left of widgetID, the new widget created thanks to new RMP_xxx() function
Parameters:
| Name | Type | Description |
|---|---|---|
| widget | object | the inserted widget |
insertBefore(widget)
This function allows you to insert on the right of widgetID, the new widget created thanks to new RMP_xxx() function
Parameters:
| Name | Type | Description |
|---|---|---|
| widget | object | the inserted widget |
insertBelow(widget)
This function allows you to insert below widgetID, the new widget created thanks to new RMP_xxx() function
Parameters:
| Name | Type | Description |
|---|---|---|
| widget | object | the inserted widget |
insertRow()
This function inserts a row before index (index is starts at '0')
Example
widgetID.insertRow("0")
isActive() → {boolean}
isActive() → {boolean}
This function returns true if the widget is active and false otherwise
Returns: boolean
isAddRows() → {boolean}
returns true if the array is allowed to add new rows and false otherwise
Returns: boolean
isColumnVisible(indexCol)
This function returns true if the the widget's column is visible and false otherwise. If the column do not exists is return false
Parameters:
| Name | Type | Description |
|---|---|---|
| indexCol | object | column's index. (indexCol starts at '0') |
isDeleteRows() → {boolean}
returns true if the array is allowed to delete rows and false otherwise
Returns: boolean
isEmptyVariable(variable) → {boolean}
This function returns true if the the widget's variable is empty and false otherwise
Parameters:
| Name | Type | Description |
|---|---|---|
| variable | object |
Returns: boolean
isEnabled() → {boolean}
This function returns true if a widget is active and false otherwise
Returns: boolean
isIndexed() → {boolean}
This function returns true if the the widget's variable is an array and false otherwise
Returns: boolean
isIndexedVariable(name) → {boolean}
This function returns true if the the widget's variable is an array and false otherwise
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String |
Returns: boolean
isModifyRows() → {boolean}
returns true if the "Can modify" field is checked and false otherwise
Returns: boolean
isRequired() → {boolean}
This function returns true if the the widget's variable is required and false otherwise
Returns: boolean
isValid(checkRules) → {boolean}
This function returns true if the the widget's variable is valid and false otherwise
Parameters:
| Name | Type | Description |
|---|---|---|
| checkRules | boolean |
Returns: boolean
isValidVariable(varName) → {boolean}
This function returns true if the the widget's variable is valid and false otherwise
Parameters:
| Name | Type | Description |
|---|---|---|
| name | String |
Returns: boolean
isVisible() → {boolean}
This function returns true if the widget is visible and false otherwise
Returns: boolean
moveAfter(widget)
This function allows you to move widgetID2 after (on the the right) widgetID1
Parameters:
| Name | Type | Description |
|---|---|---|
| widget | object | the inserted widget |
moveBefore(widget)
This function allows you to move widgetID2 before (on the left) widgetID1
Parameters:
| Name | Type | Description |
|---|---|---|
| widget | object | the inserted widget |
remove(widget)
This function allows you to remove widgetID. If removeVariable is set to true, it will also deleted content of variable attached to widget
Parameters:
| Name | Type | Description |
|---|---|---|
| widget | object | the inserted widget |
removeRow()
This function removes a given row (rowIndex starts at '0')
setActive(active)
This function allows to set the widget as active/inactive
Parameters:
| Name | Type | Description |
|---|---|---|
| active | boolean |
setAddRows(addRows)
Sets the "Add rows" field value
Parameters:
| Name | Type | Description |
|---|---|---|
| addRows | boolean |
setColumnActive(indexCol, active)
Sets a column as active or not (indexCol starts at '0')
Parameters:
| Name | Type | Description |
|---|---|---|
| indexCol | String | |
| active | boolean |
setColumnVisible(indexCol, visible)
Sets a column as visible or not (indexCol starts at '0')
Parameters:
| Name | Type | Description |
|---|---|---|
| indexCol | String | |
| visible | boolean |
setDeleteRows(deleteRows)
Sets the "Delete rows" field value
Parameters:
| Name | Type | Description |
|---|---|---|
| deleteRows | boolean |
setEnabled(e)
This function allows to set a widget as active/inactive
Parameters:
| Name | Type | Description |
|---|---|---|
| e | boolean |
setHeader(columnIndex, text)
Sets the header value of a given column of the widget array
Parameters:
| Name | Type | Description |
|---|---|---|
| columnIndex | String | |
| text | String |
setMissingVariableMessage(msg)
This function sets the message displayed if a mandatory widget's variable is missing
Parameters:
| Name | Type | Description |
|---|---|---|
| msg | String |
setModifyRows(modifyRows)
Allows you to enable or disable the add and delete row buttons on an array
Parameters:
| Name | Type | Description |
|---|---|---|
| modifyRows | boolean |
setRequired(req)
This function sets the mandatory status of the widget's variable
Parameters:
| Name | Type | Description |
|---|---|---|
| req | boolean |
setTooltip(tooltip)
This function sets the tooltip text of the widget
Parameters:
| Name | Type | Description |
|---|---|---|
| tooltip | String |
setValidationVariableMessage(msg)
This function sets the message displayed if a validation rule is not met
Parameters:
| Name | Type | Description |
|---|---|---|
| msg | String |
setValue(value)
This function sets the value of the widget's variable. It does not work for list's widgets (check box list, radio button list and list) where you should use widgetID.setSelectedValue.
Parameters:
| Name | Type | Description |
|---|---|---|
| value | String |
setVariableValue(varName, value)
This function sets the value of a given variable of the widget
Parameters:
| Name | Type | Description |
|---|---|---|
| varName | String | |
| value | String |
setVisible(v)
This function allows to set the widget as visible/invisible
Parameters:
| Name | Type | Description |
|---|---|---|
| v | boolean |