FieldsIndex

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

This class provides convenient methods that can be used to make case-insensitive lookups for a field by its name. It also provides more information such as the list of date fields in a layer.

Constructors

new FieldsIndex(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
Field[]|Object[]

An array of date fields or field json objects.

more details
FieldsIndex

Property Details

dateFields Field[]|Object[]

An array of date fields or field json objects.

Default Value:[]

Method Overview

Name Return Type Summary Class
Field

Returns a field with the specified field name.

more details
FieldsIndex
Boolean

Checks if a field with the specified field name exists in the layer.

more details
FieldsIndex
Boolean

Checks if a field with the specified field name is a date field.

more details
FieldsIndex

Method Details

get(fieldName){Field}

Returns a field with the specified field name.

Parameter
fieldName String

The name of the field. The name is case-insensitive.

Returns
Type Description
Field Returns a field with a given name.
has(fieldName){Boolean}

Checks if a field with the specified field name exists in the layer.

Parameter
fieldName String

The name of the field. The name is case-insensitive.

Returns
Type Description
Boolean Returns true if the field exists otherwise returns false.
isDateField(fieldName){Boolean}

Checks if a field with the specified field name is a date field.

Parameter
fieldName String

The name of the field.

Returns
Type Description
Boolean Returns true if the field type is date otherwise returns false.

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