Methods
# addItem(value, label)
Adds an element to a "RunMyProcess List".
Parameters:
Name | Type | Description |
---|---|---|
value |
String | Value |
label |
String | Label |
Example
list.addItem("One","1");
# fromArray(object)
Sets a "RunMyProcess List" from a JSON array.
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | JSON array |
Example
list.fromArray([{'label':'toto', 'value':2},{'label':'titi','value':3}]);
# fromJSONArray(json)
Sets a "RunMyProcess List" from the string format of a JSON array.
Parameters:
Name | Type | Description |
---|---|---|
json |
Object | JSON array |
Example
var jsonString = "[{'label':'toto', 'value':2},{'label':'titi',value:3}]";
list.fromJSONArray(jsonString);
# fromJSONObject(json)
Sets a "RunMyProcess List" from the string format of a JSON object.
Parameters:
Name | Type | Description |
---|---|---|
json |
Object | JSON object |
Example
var jsonString = '{
"list": [{"label":"aa", "value":"bb"}],
"valueField":"value",
"labelField":"label",
"listField":"list"
}';
list.fromJSONObject(jsonString);
# fromObject(object)
Sets a "RunMyProcess List" from an object configuration.
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | Object |
Example
var object = {
"list": [{"label":"aa", "value":"bb"}],
"valueField":"value",
"labelField":"label",
"listField":"list"
}
list.fromObject(object);
# getItemAt(index) → {Object}
Returns a value/label structure of a "RunMyProcess List" item
at a given index.
Parameters:
Name | Type | Description |
---|---|---|
index |
String | Index of the item (starts at 0) |
Object
Example
var myitem = list.getItemAt("0");
alert(myitem.label);
alert(myitem.value);
# getItemFromLabel(label) → {Object}
Returns an item from a list according to a given label.
Parameters:
Name | Type | Description |
---|---|---|
label |
String | Label |
Object
# getItemFromValue(value) → {Object}
Returns an item from a list according to a given value.
Parameters:
Name | Type | Description |
---|---|---|
value |
String | Value |
Object
Example
{"label":"xxx","value":"yyy"}
# getItemIndexFromLabel(label) → {int}
Returns the index of an item from a list according to a given label.
Parameters:
Name | Type | Description |
---|---|---|
label |
String | Label |
int
# getItemIndexFromValue(value) → {Object}
Returns the index of an item from a list according to a given value.
Parameters:
Name | Type | Description |
---|---|---|
value |
String | Value |
Object
# getItemLabel(item) → {String}
Returns the label of a given "RunMyProcess List" item.
Parameters:
Name | Type | Description |
---|---|---|
item |
Object | Item |
String
# getItemLabelAt(index) → {String}
Returns the label of a "RunMyProcess List" item at a given index.
Parameters:
Name | Type | Description |
---|---|---|
index |
String | Index of the item (starts at 0) |
String
Example
var item = list.getItemLabelAt("0");
# getItemLabelFromValue(value) → {String}
Returns a label from a list according to a given value.
Parameters:
Name | Type | Description |
---|---|---|
value |
String | Value |
String
# getItemValue(item) → {String}
Returns the value of a given "RunMyProcess List" item.
Parameters:
Name | Type | Description |
---|---|---|
item |
Object | Item |
String
# getItemValueAt(index) → {String}
Returns the value of a "RunMyProcess List" item at a given index.
Parameters:
Name | Type | Description |
---|---|---|
index |
String | Index of the item (starts at 0) |
String
Example
var item = list.getItemValueAt("0");
# getItemValueFromLabel(label) → {String}
Returns a value from a list according to a given label.
Parameters:
Name | Type | Description |
---|---|---|
label |
String | Label |
String
# getLabelField() → {String}
Returns the label field name of a "RunMyProcess List".
String
Example
var field = list.getLabelField();
# getValueField() → {String}
Returns the value field name of a "RunMyProcess List".
String
Example
var field = list.getValueField();
# removeItemAt(index)
Removes an item from a "RunMyProcess List" at a given index.
Parameters:
Name | Type | Description |
---|---|---|
index |
String | Index of the item (starts at 0) |
Example
list.removeItemAt("0");
# removeItemFromLabel(label)
Removes an item from a list according to a given label.
Parameters:
Name | Type | Description |
---|---|---|
label |
String | Label |
# removeItemFromValue(value)
Removes an item from a list according to a given value.
Parameters:
Name | Type | Description |
---|---|---|
value |
String | Value |
# setItemLabel(item, label)
Replaces the label of a given "RunMyProcess List" item.
Parameters:
Name | Type | Description |
---|---|---|
item |
Object | Item |
label |
String | New label |
Example
list.setItemLabelAt(item, "Ten");
# setItemLabelAt(index, label)
Replaces the label of a "RunMyProcess List" item at a given index.
Parameters:
Name | Type | Description |
---|---|---|
index |
String | Index of the item (starts at 0) |
label |
String | New label |
Example
list.setItemLabelAt("0", "Ten");
# setItemValue(item, value)
Replaces the value of a given "RunMyProcess List" item.
Parameters:
Name | Type | Description |
---|---|---|
item |
Object | Item |
value |
String | New value |
Example
list.setItemLabelAt(item, "New value");
# setItemValueAt(index, value)
Replaces the value of a "RunMyProcess List" item at a given index.
Parameters:
Name | Type | Description |
---|---|---|
index |
String | Index of the item (starts at 0) |
value |
String | New value |
Example
list.setItemValueAt("0", "10");
# setLabelField(labelField)
Sets the label field name for a "RunMyProcess List" when the label
field is not called "label".
Parameters:
Name | Type | Description |
---|---|---|
labelField |
String | Name to set |
Example
list.setLabelField("description");
# setListField(listField)
Sets the list field name for a "RunMyProcess List" when the list
field is not called "list".
Parameters:
Name | Type | Description |
---|---|---|
listField |
String | Name to set |
Example
list.setValueField("name");
# setValueField(valueField)
Sets the value field name for a "RunMyProcess List" when the value
field is not called "value".
Parameters:
Name | Type | Description |
---|---|---|
valueField |
String | Name to set |
Example
list.setValueField("name");