import FieldColumn from "@arcgis/core/widgets/FeatureTable/FieldColumn.js";const FieldColumn = await $arcgis.import("@arcgis/core/widgets/FeatureTable/FieldColumn.js");- Inheritance:
- FieldColumn→
EditorColumn→ Column→ Accessor
- 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.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
alias readonly | | |
autoWidth inherited | ||
declaredClass readonly inherited | ||
defaultValue readonly | | |
description inherited | ||
direction inherited | ||
| | ||
editInfo readonly inherited | ||
editing readonly inherited | ||
effectiveDescription readonly | | |
effectiveLabel readonly inherited | ||
| | ||
fieldName readonly inherited | ||
flexGrow inherited | ||
formatFunction readonly | | |
frozen readonly inherited | ||
frozenToEnd readonly inherited | ||
hidden inherited | ||
icon inherited | ||
iconText inherited | ||
initialSortPriority readonly inherited | ||
invalid inherited | ||
label inherited | ||
labelTooltipText inherited | ||
| | ||
maxLength readonly | | |
menu readonly inherited | ||
menuConfig readonly inherited | ||
menuIsOpen readonly inherited | ||
menuIsVisible readonly inherited | ||
minLength readonly | | |
name deprecated readonly | | |
nullable readonly | | |
| | ||
resizable readonly inherited | ||
| | ||
tableTimeZone readonly inherited | ||
| | ||
textAlign inherited | ||
textWrap inherited | ||
timeZone inherited | ||
| | ||
visibleElements inherited | ||
width inherited |
direction
- Type
- Direction
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. |
editable
- Type
- boolean
Indicates whether the field is editable. Editing permissions can be broken down with the following levels of priority:
- Field - This is derived
from the FeatureLayer or SceneLayer. It takes what is set in the
Field.editable property. This
must always be
truefor editing to be enabled. This can be overridden using a field column template. - Template - The editable permissions on a field can be configured by setting the FieldColumnTemplate.editable property of the FieldColumnTemplate.
- FeatureTable - The FeatureTable.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
FieldColumnTemplate.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.
- See also
editInfo
- Since
- ArcGIS Maps SDK for JavaScript 4.30
editing
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.30
Indicates the column is currently displaying editable inputs in one of its cells.
effectiveDescription
- Since
- ArcGIS Maps SDK for JavaScript 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.
formatFunction
- Type
- 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.
Example
// The following example demonstrates how to use the formatFunction 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.column.formatFunction = ({ column, feature, index, value })=> { const progress = document.createElement("progress"); progress.max = 100; progress.value = value; return progress;}; iconText
- Since
- ArcGIS Maps SDK for JavaScript 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.
- See also
layer
- Type
- CatalogFootprintLayer | CSVLayer | FeatureLayer | GeoJSONLayer | ImageryLayer | KnowledgeGraphSublayer | SceneLayer | WFSLayer
The associated CatalogFootprintLayer, CSVLayer, FeatureLayer, GeoJSONLayer, ImageryLayer, KnowledgeGraphSublayer, SceneLayer, or WFSLayer containing the fields and attributes to display within the widget.
menu
- Type
- HTMLElement
The element representing the field column's menu.
menuConfig
- Type
- ColumnTableMenuConfig | null | undefined
Configuration options for the column's menu.
required
- Type
- boolean
Indicates whether a value is required when editing feature attributes within the table's cell.
tableTimeZone
- Since
- ArcGIS Maps SDK for JavaScript 4.31
The FeatureTable.timeZone of the parent table widget.
template
- Type
- FieldColumnTemplate | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 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.
textWrap
- Type
- boolean
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
visibleElements
- Type
- VisibleElements | null | undefined
The visible elements of the column's associated FeatureTable.