Skip to content

RMP_Array

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 switchConf = {
    id: 'id_check',
    label: 'Checker',
    "js-type":"RMP_CheckBox",
    variables: [{ id: 'variable', name: 'foo', value: 'no' }],
    valueoff: 'no',
    valueon: 'yes',
};
var inputConf = {
    "id":"id_number1",
    "label":"My number label",
    "variable":[{"id":"variable","name":"nbr","value":15}],
    "js-type":"RMP_TextInput",
    "sub-type":'number'
};
var arrConf = {
    "id":"id_array",
    "js-type":"RMP_Array",
    "addRows": true,
    "deleteRows": true,
    "variable":[{id:"variable","name":"array"}],
    "column":[
        {"header":"Header 1","widget":inputConf},
        {"header":"Header 2","widget":switchConf}
    ]
};
var array = new RMP_Array(arrConf);
id_of_a_widget.insertAfter(array);

Methods

getColumnsCount() → {number}

Returns the number of columns of an array.

Returns: number

getHeader(columnIndex) → {string}

Returns the header value of a given column of the array.

Parameters:

Name Type Description
columnIndex number Index of the column (starts at 0)

Returns: header name of the column Type: string

getRowsCount() → {number}

Returns the number of rows of an array.

Returns: number

getType() → {string}

Returns the type of the widget (RMP_Array).

Returns: Type: string