跳到主要内容

SetListValues

设置当前组合框的列表值。

语法

expression.SetListValues(aListString);

expression - 表示 ApiComboBoxForm 类的变量。

参数

名称必需/可选数据类型默认值描述
aListString必需string[]组合框的列表值。

返回值

boolean

示例

此示例设置当前组合框的列表值。

// How to set items of the dropdown.

// Create a combobox and add its list values.

let doc = Api.GetDocument();
let comboBoxForm = Api.CreateComboBoxForm({"key": "Personal information", "tip": "Choose your country", "required": true, "placeholder": "Country", "editable": false, "autoFit": false});
let paragraph = doc.GetElement(0);
paragraph.AddElement(comboBoxForm);
comboBoxForm.SetListValues(["Latvia", "USA", "UK"]);