optionList
Overview
optionList
displays a list of options to the user. optionList
needs to be triggered from the JavaScript/TypeScript.
Basic Example
var options = [
"Add a new beneficiary", "Select an existing beneficiary", "Delete all my beneficiaries"
];
// The optionList is created as follows:
var result = optionList(options);
// When a user clicks, the result can be evaluated as follows:
if (result == 0) {
// The user clicked on "Add a new beneficiary"
}
else if (result == 2) {
// The user clicked on "Delete all my beneficiaries"
}
if (result == -1) {
// The user canceled the optionList
}

Configuration
var result = optionList(arrayOfButtons, additionalOptions);
Parameter
Required
Details
arrayOfButtons
Required
An array of strings denoting the text of the options
additionalOptions
Optional
An object with one or more of the following properties:
title: (String) The title of the optionList Defaults to
Choose an option
.
Returns: The index of the selected option. If the user cancels the optionList
, -1
will be returned.
Last updated