AMD:
require(["esri/widgets/ValuePicker/ValuePickerLabel"], (ValuePickerLabel) => { /* code goes here */ });
ESM:
import ValuePickerLabel from "@arcgis/core/widgets/ValuePicker/ValuePickerLabel.js";
Class:
esri/widgets/ValuePicker/ValuePickerLabel
Since: ArcGIS Maps SDK for JavaScript 4.27
This class represents a fixed list of predefined label values that can be assigned to a component property of the ValuePicker widget. See Using the label component to present items section for more information how to set this up.
Example
// Create a ValuePicker widget with a label component.
const valuePicker = new ValuePicker({
component: new ValuePickerLabel({
items: [
{ value: "ind", label: "Industrial" },
{ value: "res", label: "Residential" },
{ value: "com", label: "Commercial" }
]
}),
values: ["res"]
});
Constructors
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
An array of label items. | ValuePickerLabel | ||
For ValuePickerLabel the type is always "label". | ValuePickerLabel |
Property Details
-
An array of label items.
- Default Value:null
Example// Create a ValuePicker with a zip code label component. const valuePicker = new ValuePicker({ component: new ValuePickerLabel({ items: [ { value: "90606", label: "Whittier, CA (90606)" }, { value: "76001", label: "Arlington, TX (76001)" }, { value: "92335", label: "Fontana, CA (92335)" } ] }), values: ["90606"] });
-
type
type Stringreadonly
-
For ValuePickerLabel the type is always "label".