跳到主要内容

CreateComboBoxContentControl

Creates a new combo box container with the given list of options.

Syntax

expression.CreateComboBoxContentControl(list, selected);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
listOptionalContentControlListItem[]An array of objects representing the items in the combo box.
selectedOptionalnumber-1The selected item index.

Returns

ApiInlineLvlSdt

Example

This example shows how to create a combo box content control.

let doc = Api.GetDocument();
let cc = Api.CreateComboBoxContentControl([{display: 'one', value: '1'}, {display: 'two', value: '2'}], 1);
let paragraph = Api.CreateParagraph();
paragraph.Push(cc);
doc.Push(paragraph);