Skip To ContentArcGIS for DevelopersSign In Dashboard
require(["esri/layers/support/FieldsIndex"], function(FieldsIndex) { /* code goes here */ });
Class: esri/layers/support/FieldsIndex
Since: ArcGIS API 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

NameTypeSummaryClass
Field[]|Object[]

An array of date fields or field json objects.

more details
more detailsFieldsIndex

Property Details

dateFields Field[]|Object[]

An array of date fields or field json objects.

Default Value:[]

Method Overview

NameReturn TypeSummaryClass
Field

Returns a field with the specified field name.

more details
more detailsFieldsIndex
Boolean

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

more details
more detailsFieldsIndex
Boolean

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

more details
more detailsFieldsIndex

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:
TypeDescription
FieldReturns 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:
TypeDescription
BooleanReturns 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:
TypeDescription
BooleanReturns true if the field type is date otherwise returns false.

API Reference search results

NameTypeModule
Loading...