跳到主要内容

GetOptions

Gets all options from list options.

Syntax

expression.GetOptions();

expression - A variable that represents a ApiListboxField class.

Parameters

This method doesn't have any parameters.

Returns

ListOption[]

Example

This example gets options from field with list of options.

let doc = Api.GetDocument();
let page = doc.GetPage(0);
let comboboxField = Api.CreateComboboxField([10, 10, 160, 30]);
page.AddObject(comboboxField);

comboboxField.AddOption('Option 1');
comboboxField.AddOption('Option 2');
comboboxField.AddOption('Option 3');
let options = comboboxField.GetOptions();
console.log('Combobox options is: ' + options);