ValuePickerCollection

AMD: require(["esri/widgets/ValuePicker/ValuePickerCollection"], (ValuePickerCollection) => { /* code goes here */ });
ESM: import ValuePickerCollection from "@arcgis/core/widgets/ValuePicker/ValuePickerCollection.js";
Class: esri/widgets/ValuePicker/ValuePickerCollection
Since: ArcGIS Maps SDK for JavaScript 4.27

This class represents an ordered collection of values that can be assigned to the component property of a ValuePicker widget and can be interacted with at runtime. See Using an arbitrary collection component to present predefined list section for more information how to set this up.

Example
// Assign a collection of objects to the ValuePicker.
const collection = new Collection([
  { name: "Isaac Newton", dob: new Date(1643, 0, 4)},
  { name: "Albert Einstein", dob: new Date(1879, 2, 14)},
  { name: "Ernest Rutherford", dob: new Date(1871, 7, 20)}
]);

const valuePicker = new ValuePicker({
  component: new ValuePickerCollection({ collection }),
  values: [collection.at(0)]
});

reactiveUtils.watch(
  () => valuePicker.values,
  (values) => {
    const scientist = values[0];
    console.log(`${scientist.name} was born on ${scientist.age.toDateString()}`);
  }
);

Constructors

ValuePickerCollection

Constructor
new ValuePickerCollection(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
Collection

A collection of values that can be navigated or animated with the play, next, and previous buttons on the ValuePicker widget..

ValuePickerCollection
String For ValuePickerCollection the type is always "collection". ValuePickerCollection

Property Details

collection

Property
collection Collectionautocast

A collection of values that can be navigated or animated with the play, next, and previous buttons on the ValuePicker widget..

Default Value:null
Example
const valuePicker = new ValuePicker({
  values: ["hybrid"]
  component: new ValuePickerCollection({
    collection: ["hybrid", "oceans", "osm"] // autocast to Collection
  })
});

type

Property
type Stringreadonly

For ValuePickerCollection the type is always "collection".

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