FieldColumn

AMD: require(["esri/widgets/FeatureTable/FieldColumn"], (FieldColumn) => { /* code goes here */ });
ESM: import FieldColumn from "@arcgis/core/widgets/FeatureTable/FieldColumn.js";
Class: esri/widgets/FeatureTable/FieldColumn
Inheritance: FieldColumn→Accessor→Column
Since: ArcGIS Maps SDK for JavaScript 4.16

The FieldColumn class works with the FeatureTable and provides the underlying logic for column behavior.

This class should be used for observing potential changes. Any configuration and changes to the field columns should be done handled via the TableTemplate and the FieldColumnTemplate class.

See also

Constructors

FieldColumn

Constructor
new FieldColumn(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 Watch for changes topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

The display name for the field.

FieldColumn

Indicates if the column width will automatically adjust to account for large content.

Column

The name of the class.

Accessor

The default value set for the field.

FieldColumn

Contains information describing the purpose of each column.

Column

Controls the sort order of the column.

Column

Indicates whether the field is editable.

FieldColumn

The sanitized description, describing the purpose of each column.

FieldColumn

The sanitized label string safe for display in the header cell.

Column

The Field associated with this column.

FieldColumn

The unique field name as defined by the data source.

Column

Controls the flex-grow property for the column.

Column

Custom function for rendering cell content that is called when the column is rendered in the table.

FieldColumn

Indicates if the the column is frozen in place at the beginning of the table.

Column

Indicates if the column is frozen in place at the end of the table.

Column

Indicates whether the column is visible.

Column

The string value indicating the icon displayed in the header cell of the column.

Column

The string value displayed when hovering over the associated icon displayed in the header cell of the column.

Column

Indicates the initial sort priority of the column when first rendered.

Column

Indicates whether the column is in an invalid state.

Column

The default label displayed in the column header cell.

Column

The associated CatalogFootprintLayer, CSVLayer, FeatureLayer, GeoJSONLayer, ImageryLayer, KnowledgeGraphSublayer, SceneLayer, or WFSLayer containing the fields and attributes to display within the widget.

FieldColumn

Restricts the input length for the column.

FieldColumn

The element representing the field column's menu.

Column

Configuration options for the column's menu.

Column

Indicates whether the column's menu is currently open.

Column

Indicates whether the Column's menu will be displayed.

Column

Restricts the input length for the column.

FieldColumn

The name of the field.

FieldColumn

Indicates if the field can accept null values.

FieldColumn

Indicates whether a value is required when editing feature attributes within the table's cell.

FieldColumn

Indicates whether the column is resizable.

Column

Indicates whether the column is sortable.

FieldColumn

The timeZone of the parent table widget.

Column

A configurable template for the table column.

FieldColumn

Aligns the columns cell content horizontally.

Column

Indicates cell content should be wrapped and displayed on multiple lines within the cell.

Column

The storage IANA time zone of the column.

Column

A reference to the MapView or SceneView.

FieldColumn

The visible elements of the column's associated FeatureTable.

Column

Width of the column in pixels.

Column

Property Details

alias

Property
alias String |null |undefinedreadonly

The display name for the field.

autoWidth

Inherited
Property
autoWidth Boolean
Inherited from Column

Indicates if the column width will automatically adjust to account for large content. The column ignores the current width property when autoWidth is true.

Default Value:false

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

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

defaultValue

Property
defaultValue Number |String |null |undefinedreadonly

The default value set for the field.

description

Inherited
Property
description String |null |undefined
Inherited from Column

Contains information describing the purpose of each column.

direction

Inherited
Property
direction String |null |undefined
Inherited from Column

Controls the sort order of the column. This property will only be honored on one column in the FeatureTable widget. If direction is specified on more than one column in the same FeatureTable, it will only be honored on the column with the highest index.

This is used in combination with the initialSortPriority and FeatureTable.multiSortEnabled properties to set sorting functionality for multiple columns.

Possible Value Description
asc Sorts the column in ascending order.
desc Sorts the column in descending order.
null No sort is applied to the column.

Possible Values:"asc" |"desc"

editable

Property
editable Boolean

Indicates whether the field is editable. Editing permissions can be broken down with the following levels of priority:

  1. Field - This is derived from the FeatureLayer or SceneLayer. It takes what is set in the Field.editable property. This must always be true for editing to be enabled. This can be overridden using a field column template.
  2. Template - The editable permissions on a field can be configured by setting the editable property of the FieldColumnTemplate.
  3. FeatureTable - The editingEnabled property must be set on the table in order for any type of editing to be enabled.

For example, if table editing is disabled in the widget, i.e. enableEditing is not set, it is still possible to enable editing for a specific column by setting the editable property. Vice versa is also true, if table editing is enabled, a field template can be used to disable editing for a specific column.

Ultimately, if the service's field is not editable, it is not possible to override its permissions using one of the options above.

effectiveDescription

Property
effectiveDescription String |null |undefinedreadonly
Since: ArcGIS Maps SDK for JavaScript 4.31 FieldColumn since 4.16, effectiveDescription added at 4.31.

The sanitized description, describing the purpose of each column. This takes into account the optional values of both the columns's template description and the value of the field's description. The template description takes precedence over the field's description as to allow for customizing the column's description.

effectiveLabel

Inherited
Property
effectiveLabel String
Inherited from Column

The sanitized label string safe for display in the header cell. Defaults to using fieldName if a label is not defined on the column.

field

Property
field Fieldautocast

The Field associated with this column.

fieldName

Inherited
Property
fieldName Stringreadonly
Inherited from Column

The unique field name as defined by the data source.

flexGrow

Inherited
Property
flexGrow Number
Inherited from Column

Controls the flex-grow property for the column. When set to 0, cell width is fixed.

Default Value:1

formatFunction

Property
formatFunction FieldValueFormatFunction |null |undefined

Custom function for rendering cell content that is called when the column is rendered in the table. The function should return the formatted content to display within a table's cell. This can be a string, number, an HTML element, or equivalent node type (e.g. a Calcite component). If the content is an HTML element, it is appended to the root element. If the content is a string or number, it is set as the innerHTML of the root element. If the content is null, the root element is cleared. If the content is undefined, the root element is not modified. This property is useful when you want to customize the cell content. For example, you can use this property to create a custom cell renderer that displays a progress bar in the cell. The progress bar can be used to show the progress of a task.

frozen

Inherited
Property
frozen Booleanreadonly
Inherited from Column

Indicates if the the column is frozen in place at the beginning of the table. Column must be first in the FeatureTable's column's, or next to other frozen columns.

Default Value:false

frozenToEnd

Inherited
Property
frozenToEnd Booleanreadonly
Inherited from Column

Indicates if the column is frozen in place at the end of the table. Column must be last in the FeatureTable's column's, or next to other columns with frozenToEnd set to true.

Default Value:false

hidden

Inherited
Property
hidden Boolean
Inherited from Column

Indicates whether the column is visible.

Default Value:false

icon

Inherited
Property
icon String |null |undefined
Inherited from Column

The string value indicating the icon displayed in the header cell of the column.

iconText

Inherited
Property
iconText String |null |undefined
Inherited from Column
Since: ArcGIS Maps SDK for JavaScript 4.32 Column since 4.30, iconText added at 4.32.

The string value displayed when hovering over the associated icon displayed in the header cell of the column. When a value is not provied, the column label is displayed instead. A value for 'icon' must also be set on the column.

initialSortPriority

Inherited
Property
initialSortPriority Number |null |undefinedreadonly
Inherited from Column

Indicates the initial sort priority of the column when first rendered.

invalid

Inherited
Property
invalid Boolean
Inherited from Column

Indicates whether the column is in an invalid state.

Default Value:undefined

label

Inherited
Property
label String |null |undefined
Inherited from Column

The default label displayed in the column header cell.

maxLength

Property
maxLength Numberreadonly

Restricts the input length for the column.

Inherited
Property
menu HTMLElementreadonly
Inherited from Column

The element representing the field column's menu.

Inherited
Property
menuConfig ColumnTableMenuConfig |null |undefinedreadonly
Inherited from Column

Configuration options for the column's menu.

FeatureTable.tableTemplate.

Inherited
Property
menuIsOpen Booleanreadonly
Inherited from Column
Since: ArcGIS Maps SDK for JavaScript 4.30 Column since 4.30, menuIsOpen added at 4.30.

Indicates whether the column's menu is currently open.

Inherited
Property
menuIsVisible Booleanreadonly
Inherited from Column
Since: ArcGIS Maps SDK for JavaScript 4.30 Column since 4.30, menuIsVisible added at 4.30.

Indicates whether the Column's menu will be displayed.

minLength

Property
minLength Number |null |undefinedreadonly

Restricts the input length for the column.

name

Property
name String |null |undefinedreadonly
Deprecated since version 4.30, use FieldColumn.fieldName instead.

The name of the field.

nullable

Property
nullable Booleanreadonly

Indicates if the field can accept null values.

required

Property
required Boolean

Indicates whether a value is required when editing feature attributes within the table's cell.

resizable

Inherited
Property
resizable Booleanreadonly
Inherited from Column

Indicates whether the column is resizable.

Default Value:true

sortable

Property
sortable Boolean

Indicates whether the column is sortable.

Default Value:true

tableTimeZone

Inherited
Property
tableTimeZone String |null |undefined
Inherited from Column
Since: ArcGIS Maps SDK for JavaScript 4.31 Column since 4.30, tableTimeZone added at 4.31.

The timeZone of the parent table widget.

template

Property
template FieldColumnTemplate |null |undefined
Since: ArcGIS Maps SDK for JavaScript 4.28 FieldColumn since 4.16, template added at 4.28.

A configurable template for the table column. The template allows for customizing the appearance of the column. Once the template is set, it will override the default appearance and will remain as such once the table is created. Any information regarding the column's current state can be accessed using the Column class.

Templates should be used primarily for initial column configuration and should not be used for observing changes.

textAlign

Inherited
Property
textAlign String
Inherited from Column

Aligns the columns cell content horizontally.

Possible Values:"start" |"center" |"end"

Default Value:"start"

textWrap

Inherited
Property
textWrap Boolean
Inherited from Column

Indicates cell content should be wrapped and displayed on multiple lines within the cell. Warning: this causes rows to expand when tall content is visible in the viewport. Scrolling tall cells into the viewport may cause the table to visually jump depending on the height of the expanding rows.

Default Value:false

timeZone

Inherited
Property
timeZone String |null |undefined
Inherited from Column

The storage IANA time zone of the column.

view

Property
view MapView |SceneView |null |undefined

A reference to the MapView or SceneView.

visibleElements

Inherited
Property
visibleElements VisibleElements |null |undefined
Inherited from Column

The visible elements of the column's associated FeatureTable.

width

Inherited
Property
width Number |String
Inherited from Column

Width of the column in pixels. If providing value as a string, the string must include "px" suffix. This value is only honored when there are enough columns to fill the viewport, or flexGrow has been set to 0.

Default Value:200

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor

Convenience method for closing the column menu.

Column

Returns true if a named group of handles exist.

Accessor

Convenience method for opening the column menu.

Column

Removes a group of handles owned by the object.

Accessor

Convenience method for sorting the current column.

Column

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, addHandles added at 4.25.

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

closeMenu

Inherited
Method
closeMenu()
Inherited from Column

Convenience method for closing the column menu.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

openMenu

Inherited
Method
openMenu()
Inherited from Column

Convenience method for opening the column menu. This has no effect if the menu is not visible or has no menu items. It follows the direction pattern of ascending, to descending, then no sort order.

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

sort

Inherited
Method
sort()
Inherited from Column

Convenience method for sorting the current column. It has no effect if column sorting is disabled.

Type Definitions

FieldValueFormatFunction

Type Definition
FieldValueFormatFunction(params){String |Number |HTMLElement |null |undefined}

Custom function for rendering cell content. Accepts a string, number, an HTML element or equivalent node type (e.g. a Calcite component).

Parameters
Specification
params Object

An object containing information about the associated row and feature.

Specification
attachments AttachmentInfo[]

(Since 4.31) A reference to attachments for the associated feature.

column Column

A reference to this specific Column.

feature Graphic

A reference to the feature represented by the associated row.

index Number

Index of the associated row being rendered.

relatedRecords RelatedRecordInfo[]

(Since 4.31) A reference to related records for the associated feature.

virtualIndex Number

(Since 4.31) Virtual index of the associated row being rendered. Unlike index, a row's virtualIndex changes as the table scrolls. The first row in the DOM has a virtualIndex of 0. As rows are added/removed from the DOM, the virtual index adjusts before it renders. This can help with performance when rendering large datasets.

Current projected value of the cell.

field Field

The field associated with the column.

Returns
Type Description
String | Number | HTMLElement | null | undefined Formatted content to be displayed in the cell.

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