IsEditable
检查组合框文本是否可编辑。如果不可编辑,则此表单为下拉列表。
语法
expression.IsEditable();
expression - 表示 ApiComboBoxForm 类的变量。
参数
此方法没有任何参数。
返回值
boolean
示例
确定用户是否可以在文档中的组合框表单中输入自定义文本。
// How do I check if a combo box form allows free-text input in a document?
// Show whether a combo box restricts selection to preset options or permits manual entry in a document.
let doc = Api.GetDocument();
let comboBoxForm = Api.CreateComboBoxForm({"key": "Personal information", "tip": "Choose your country", "required": true, "placeholder": "Country", "editable": false, "autoFit": false, "items": ["Latvia", "USA", "UK"]});
let paragraph = doc.GetElement(0);
paragraph.AddElement(comboBoxForm);
let editable = comboBoxForm.IsEditable();
paragraph = Api.CreateParagraph();
paragraph.AddText("The first combo box from this document is editable: " + editable);
doc.Push(paragraph);