此类表示一个可搜索的组合框列表组件,该组件可以分配给 ValuePicker 微件的 component 属性。有关如何设置此类的详细信息,请参阅使用组合框组件来显示可选项目部分。
示例
// Create a ValuePicker widget with a combobox component.
const valuePicker = new ValuePicker({
component: new ValuePickerCombobox({
placeholder: "Pick Zoning Type",
items: [
{ value: "ind", label: "Industrial" },
{ value: "res", label: "Residential" },
{ value: "com", label: "Commercial" }
]
}),
values: ["res"]
});
构造函数
属性概述
名称 | 类型 | 描述 | 类 |
---|---|---|---|
ComboboxItem[] | 组合框项目的数组。 更多详情 | ValuePickerCombobox | |
String | 组合框标注。 更多详情 | ValuePickerCombobox | |
String | 组合框占位符文本。 更多详情 | ValuePickerCombobox | |
String | 对于 ValuePickerCombobox,类型总是 "combobox"。更多详情 | ValuePickerCombobox |
属性详细信息
-
items ComboboxItem[]
-
组合框项目的数组。
- 默认值:null
示例// Create a ValuePicker with a zip code combobox component. const valuePicker = new ValuePicker({ component: new ValuePickerCombobox({ placeholder: "Pick a Zip Code", items: [ { value: "90606", label: "Whittier, CA (90606)" }, { value: "76001", label: "Arlington, TX (76001)" }, { value: "92335", label: "Fontana, CA (92335)" } ] }), values: ["90606"] });
-
label String
-
组合框标注。
- 默认值:"ValuePickerCombobox"
-
placeholder String
-
组合框占位符文本。
- 默认值:null
-
type Stringreadonly
-
对于 ValuePickerCombobox,类型总是 "combobox"。