FieldInfo

AMD: require(["esri/popup/FieldInfo"], (FieldInfo) => { /* code goes here */ });
ESM: import FieldInfo from "@arcgis/core/popup/FieldInfo";
Class: esri/popup/FieldInfo
Inheritance: FieldInfo Accessor
Since: ArcGIS API for JavaScript 4.11

The FieldInfo class defines how a Field participates, or in some cases, does not participate, in a PopupTemplate.

See also:
Example:
let fieldInfo = new FieldInfo({
  fieldName: 'PROMINENCE_ft',
  label: 'Prominence (feet)',
  //autocasts to FieldInfo.Format
  format: {
    places: 0,
    digitSeparator: true
  }
};

Constructors

new FieldInfo(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
Stringmore details

The name of the class.

more detailsAccessor
Stringmore details

The field name as defined by the service or the name of an Arcade expression.

more detailsFieldInfo
FieldInfoFormatmore details

Class which provides formatting options for numerical or date fields and how they should display within a popup.

more detailsFieldInfo
Booleanmore details

A Boolean determining whether users can edit this field.

more detailsFieldInfo
Stringmore details

A string containing the field alias.

more detailsFieldInfo
Stringmore details

Used in a one:many or many:many relationship to compute the statistics on the field to show in the popup.

more detailsFieldInfo
Stringmore details

A string determining what type of input box editors see when editing the field.

more detailsFieldInfo
Stringmore details

A string providing an editing hint for editors of the field.

more detailsFieldInfo
Booleanmore details

Indicates whether the field is visible in the popup window.

more detailsFieldInfo

Property Details

declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

fieldName String

The field name as defined by the service or the name of an Arcade expression. Arcade expression names are defined in the expressionInfos property. When referencing Arcade expressions, you must preface the name with expression/, such as expression/percent-total.

Class which provides formatting options for numerical or date fields and how they should display within a popup.

Set the popupTemplate.fieldInfos property for any fields that need to have number formatting for chart/text elements.

isEditable Boolean

A Boolean determining whether users can edit this field. This is not applicable to Arcade expressions.

Default Value:false
label String

A string containing the field alias. Not applicable to Arcade expressions as the title is used instead.

statisticType String

Used in a one:many or many:many relationship to compute the statistics on the field to show in the popup. If the property is present, must be one of the following values:

Possible Values:"count"|"sum"|"min"|"max"|"avg"|"stddev"|"var"

stringFieldOption String

A string determining what type of input box editors see when editing the field. Applies only to string fields. This is not applicable to Arcade expressions. If this property is present, it must be one of the following values:

Possible Values:"rich-text"|"text-area"|"text-box"

Default Value:text-box
tooltip String

A string providing an editing hint for editors of the field. This is not applicable to Arcade expressions.

visible Boolean

Indicates whether the field is visible in the popup window.

As of version 4.16, the default Popup has been improved to no longer display system fields that do not hold significant value, e.g. Shape__Area and Shape__Length are two fields that no longer display.

Default Value:true

Method Overview

Name Return Type Summary Class
FieldInfomore details

Creates a deep clone of the FieldInfo class.

more detailsFieldInfo
*more details

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product.

more detailsFieldInfo
Objectmore details

Converts an instance of this class to its ArcGIS portal JSON representation.

more detailsFieldInfo

Method Details

clone(){FieldInfo}

Creates a deep clone of the FieldInfo class.

Returns:
Type Description
FieldInfo A deep clone of the FieldInfo instance.
fromJSON(json){*}static

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameter:
json Object

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns:
Type Description
* Returns a new instance of this class.
toJSON(){Object}

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns:
Type Description
Object The ArcGIS portal JSON representation of an instance of this class.

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