Skip to content
import AttributeTableTemplate from "@arcgis/core/tables/AttributeTableTemplate.js";
Inheritance:
AttributeTableTemplateAccessor
Since
ArcGIS Maps SDK for JavaScript 4.31

An AttributeTableTemplate manages the configuration of how the FeatureTable widget displays its columns. This template allows you to define properties such as visibility, order, and sorting of the table's columns. It can be applied directly to a FeatureLayer.attributeTableTemplate, CSVLayer.attributeTableTemplate, GeoJSONLayer.attributeTableTemplate, CatalogFootprintLayer.attributeTableTemplate, SubtypeSublayer.attributeTableTemplate, a FeatureTable.attributeTableTemplate, or FeatureTable's view model. The AttributeTableTemplate consists of various elements that represent specific types of columns in a table. It can be serialized to JSON, enabling the persistence of the table's configuration. This feature facilitates easy sharing and reuse of table configurations across different applications.

Tables can be created with a variety of elements, including:

If a table is configured using another application such as Map Viewer, the resulting saved layer or web map item's JSON will contain a attributeTableInfo object.

Considerations

The layers that honor the attributeTableTemplate property are: CatalogFootprintLayer CSVLayer FeatureLayer GeoJSONLayer MapImageLayer (sublayer) SubtypeSublayer SceneLayer

This class differs from TableTemplate. The TableTemplate class provides more fine-grained control over how the table is rendered within an application by offering more advanced configurations such as custom cell rendering, column formatting, and more. TableTemplate is useful for application-level development that remains within an application. Use AttributeTableTemplate to access the table's settings across different applications since they can be saved within a webmap or layer. Please refer to the TableTemplate documentation for more information.

The FeatureTable prioritizes the table's configurations in the following order:

  1. The TableTemplate defined in the FeatureTable.
  2. The FeatureTable.attributeTableTemplate defined in the FeatureTable.
  3. The attributeTableTemplate defined in the layer or standalone table.
  4. Default columns are generated based on the layer's fields if no table templates exist.
See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

elements

autocast Property
Type
AttributeTableElementType[] | null | undefined

An array of attribute table element objects that represent an ordered list of table elements.

Table elements are designed to allow the table author the ability to define the layout for fields when displaying and/or editing data.

Nested group table elements are not supported.

See also

orderByFields

autocast Property
Type
AttributeTableFieldOrder[] | null | undefined

An Array of AttributeTableFieldOrder objects indicating the records' sort order.

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
clone(): AttributeTableTemplate
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

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.

Parameters
ParameterTypeDescriptionRequired
json
any

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
any

Returns a new instance of this class.

clone

Method
Signature
clone (): AttributeTableTemplate

Creates a deep clone of the AttributeTableTemplate class.

Returns
AttributeTableTemplate

A deep clone of the AttributeTableTemplate instance.

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

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

Returns
any

The ArcGIS portal JSON representation of an instance of this class.