ValuePickerLabel

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

ValuePickerLabel

Constructor
new ValuePickerLabel(properties)
Parameter
properties Object
optional

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

items

Property
items labelitem[]

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

Property
type Stringreadonly

For ValuePickerLabel the type is always "label".

Type Definitions

labelitem

Type Definition
labelitem

Object used to define the label items.

Properties
value String

The value of the item.

label String

The label users will see for this item.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.