@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
561 lines (556 loc) • 125 kB
TypeScript
import type Collection from "../core/Collection.js";
import type Relationship from "../layers/support/Relationship.js";
import type AttributeTableTemplate from "../tables/AttributeTableTemplate.js";
import type TimeExtent from "../time/TimeExtent.js";
import type LinkChartView from "../views/LinkChartView.js";
import type SelectionManager from "../views/SelectionManager.js";
import type LayerView from "../views/layers/LayerView.js";
import type Widget from "./Widget.js";
import type ActionColumn from "./FeatureTable/ActionColumn.js";
import type AttachmentsColumn from "./FeatureTable/AttachmentsColumn.js";
import type FeatureTableViewModel from "./FeatureTable/FeatureTableViewModel.js";
import type FieldColumn from "./FeatureTable/FieldColumn.js";
import type RelationshipColumn from "./FeatureTable/RelationshipColumn.js";
import type VisibleElements from "./FeatureTable/VisibleElements.js";
import type GroupColumn from "./FeatureTable/Grid/GroupColumn.js";
import type AttachmentsViewOptions from "./FeatureTable/support/AttachmentsViewOptions.js";
import type TableTemplate from "./FeatureTable/support/TableTemplate.js";
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
import type { GeometryUnion } from "../geometry/types.js";
import type { TimeZone } from "../time/types.js";
import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
import type { ObjectId } from "../views/types.js";
import type { WidgetProperties } from "./Widget.js";
import type { FeatureTableViewModelEvents, FeatureTableViewModelProperties } from "./FeatureTable/FeatureTableViewModel.js";
import type { Direction, DiscardPendingEditsParameters, FeatureStoreEdits, FeatureTableState, GridMultiSortPriority, GridSupportedColumns, TableMenuConfig } from "./FeatureTable/Grid/types.js";
import type { ActionColumnConfig, ColumnSortOrder, FeatureStoreItem, FeatureTableSupportedColumn, FeatureTableSupportedFilters, FeatureTableSupportedLayer } from "./FeatureTable/support/types.js";
import type { AttributeTableTemplateProperties } from "../tables/AttributeTableTemplate.js";
import type { MeshProperties } from "../geometry/Mesh.js";
import type { PolylineProperties } from "../geometry/Polyline.js";
import type { PolygonProperties } from "../geometry/Polygon.js";
import type { PointProperties } from "../geometry/Point.js";
import type { MultipointProperties } from "../geometry/Multipoint.js";
import type { ExtentProperties } from "../geometry/Extent.js";
import type { TableTemplateProperties } from "./FeatureTable/support/TableTemplate.js";
import type { TimeExtentProperties } from "../time/TimeExtent.js";
import type { VisibleElementsProperties } from "./FeatureTable/VisibleElements.js";
export interface FeatureTableProperties extends WidgetProperties, Partial<Pick<FeatureTable, "actionColumnConfig" | "attachmentsEnabled" | "attachmentsViewOptions" | "autoRefreshEnabled" | "autoSaveEnabled" | "columnPerformanceModeEnabled" | "columnReorderingEnabled" | "definitionExpression" | "description" | "disabled" | "editingEnabled" | "filterBySelectionEnabled" | "highlightEnabled" | "initialSize" | "layer" | "layers" | "maxSize" | "menuConfig" | "multipleSelectionEnabled" | "multipleSortPriority" | "multiSortEnabled" | "navigationScale" | "noDataMessage" | "outFields" | "pageSize" | "paginationEnabled" | "relatedRecordsEnabled" | "returnGeometryEnabled" | "returnMEnabled" | "returnZEnabled" | "selectionManager" | "syncTemplateOnChangesEnabled" | "syncViewSelection" | "syncWithViewSelectionManager" | "timeZone" | "title" | "view">> {
/**
* Use this property to configure how columns display within the table in regard to visibility, column order, and sorting.
*
* > [!WARNING]
* >
* > This property differs from the [tableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#tableTemplate) property. The `tableTemplate` property provides more fine-grained control over how the table is rendered within the application by offering more advanced configurations such as custom cell rendering, column formatting, and more. It is useful for application-level development that remains within an application. Use the [attributeTableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#attributeTableTemplate) property to access the table's settings across different applications. By using this property, the settings can be saved within a webmap or layer. Please refer to the [AttributeTableTemplate](https://developers.arcgis.com/javascript/latest/references/core/tables/AttributeTableTemplate/) and [TableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/) documentation for more information.
*
* @since 4.31
* @see [Sample - FeatureTable Component](https://developers.arcgis.com/javascript/latest/sample-code/feature-table/)
*/
attributeTableTemplate?: AttributeTableTemplateProperties | null;
/**
* The ID or node representing the DOM element containing the widget.
* Take note that this property can only be set once. The snippets below provide some examples for setting this.
*
* > [!WARNING]
* >
* > The [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) widget's container property must be set within its constructor and not via the [view.ui.add()](https://developers.arcgis.com/javascript/latest/references/core/views/ui/UI/#add) method.
*
* @example
* // Create the HTML div element programmatically at runtime and set to the widget's container
* const featureTable = new FeatureTable({
* view: view,
* container: document.createElement("tableDiv")
* });
* @example
* // Specify an already-defined HTML div element in the widget's container
*
* const featureTable = new FeatureTable({
* view: view,
* container: featureTableDiv
* });
*
* // HTML markup
* <body>
* <div id="viewDiv"></div>
* <div class="container">
* <div id="tableDiv"></div>
* </div>
* </body>
* @example
* // Create the HTML div element programmatically at runtime and set to the widget's container
* const basemapGallery = new BasemapGallery({
* view: view,
* container: document.createElement("div")
* });
*
* // Add the widget to the top-right corner of the view
* view.ui.add(basemapGallery, {
* position: "top-right"
* });
* @example
* // Specify an already-defined HTML div element in the widget's container
*
* const basemapGallery = new BasemapGallery({
* view: view,
* container: basemapGalleryDiv
* });
*
* // Add the widget to the top-right corner of the view
* view.ui.add(basemapGallery, {
* position: "top-right"
* });
*
* // HTML markup
* <body>
* <div id="viewDiv"></div>
* <div id="basemapGalleryDiv"></div>
* </body>
* @example
* // Specify the widget while adding to the view's UI
* const basemapGallery = new BasemapGallery({
* view: view
* });
*
* // Add the widget to the top-right corner of the view
* view.ui.add(basemapGallery, {
* position: "top-right"
* });
*/
container?: HTMLElement | string | null;
/**
* Set this property to filter the features displayed in the table. It accepts a [Geometry](https://developers.arcgis.com/javascript/latest/references/core/geometry/Geometry/), e.g. [Extent](https://developers.arcgis.com/javascript/latest/references/core/geometry/Extent/), and uses it as a spatial filter. When modifying this property, the `FeatureTable` will completely refresh and re-query for all features.
*
* @since 4.19
* @see [Sample - FeatureTable using a map](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-map/)
* @see [Sample - FeatureTable with related data](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-relates/)
* @example
* // Listen for when the view is stationary.
* // If true, check the view's extent and set
* // the table to display only the attributes
* // for the features falling within this extent.
*
* reactiveUtils.when( () => view.stationary === true,
* () => {
* // Get the new extent of view/map whenever map is updated.
* if (view.extent) {
* // Filter out and show only the visible features in the feature table.
* featureTable.filterGeometry = view.extent;
* }
* }, { initial: true });
*/
filterGeometry?: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null;
/**
* A collection of string values which indicate [field.names](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/) that should be hidden within the table. By default fields such as `CreationDate`, `Creator`, `EditDate`, `Editor`, and `GlobalID` do not show. If these fields are needed, set them via [TableTemplate.columnTemplates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/#columnTemplates). In this case, it is required to set column template's [FieldColumnTemplate.visible](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/#visible) property to `true`.
*
* @since 4.16
* @see [TableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/)
* @see [FieldColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/)
* @example
* const featureTable = new FeatureTable({
* layer: featureLayer,
* view: view,
* hiddenFields: ["Primary_Type", "incident_date"], // will not show these two fields within the table
* container: document.getElementById("tableDiv")
* });
* @example
* // Set this syntax if needing to display a default hidden field, e.g. 'CreationDate`
* const featureTable = new FeatureTable({
* layer: featureLayer,
* view: view,
* tableTemplate: { // autocastable to TableTemplate
* columnTemplates: [ // takes an array of FieldColumnTemplate and GroupColumnTemplate
* { //autocastable to FieldColumnTemplate
* type: "field",
* fieldName: "date_created",
* label: "Date created",
* visible: true
* }]
* }
* container: document.getElementById("tableDiv")
* });
*/
hiddenFields?: ReadonlyArrayOrCollection<string>;
/**
* This property accepts and returns a collection of feature object IDs. Use this to access and control which features are currently selected in the table and subsequently highlighted within the map. Once an application sets a collection of object IDs, the table will select the corresponding row and highlight its feature within the map.
*
* @since 4.25
* @see [highlightEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#highlightEnabled)
* @see [Sample - FeatureTable using a map](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-map/)
* @see [Sample - FeatureTable with popup interaction](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-popup-interaction/)
* @see [Sample - FeatureTable with related data](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-relates/)
* @see [Sample - FeatureTable with row highlighting](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-row-highlights/)
* @example
* // This example instantiates the table with highlighted features
* const featureTable = new FeatureTable({
* view: view,
* layer: featureLayer,
* container: "tableDiv",
* highlightIds
* });
*
* // Push the object IDs into a collection and select
* featureTable.highlightIds.push(2, 3, 4);
*
* // Listen for changes in the collection of highlighted features
* featureTable.highlightIds.on("change", (event) => {
* console.log("features selected", event.added);
* console.log("features deselected", event.removed);
* });
*/
highlightIds?: ReadonlyArrayOrCollection<ObjectId>;
/**
* The string value which indicates the displayed [icon](https://developers.arcgis.com/calcite-design-system/icons/).
*
* @default "table"
* @since 4.27
* @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
* @see [Sample - FeatureTable with related data](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-relates/)
* @see [Sample - FeatureTable with custom content](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-custom-content/)
* @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
*/
icon?: Icon["icon"] | null;
/**
* The widget's default label.
*
* @since 4.11
*/
label?: string | null;
/**
* This property accepts and returns a collection of feature object IDs. Use this to access and control which features are currently visible in the table.
* When the collection is empty, all potential rows are displayed. Modifying object IDs is not supported while [filterBySelectionEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filterBySelectionEnabled) is `true` as these properties are mutually exclusive.
* This filter can also be combined with [filterGeometry](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filterGeometry) to display features that satisfy both conditions.
*
* @since 4.30
*/
objectIds?: ReadonlyArrayOrCollection<ObjectId>;
/**
* Represents the index of the page of the feature currently being displayed. The number of features per page can be adjusted by modifying the [pageSize](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#pageSize). [Pagination](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#paginationEnabled) must be enabled or the value of this property may not be not reliable due to virtualization of visible pages.
*
* @since 4.31
*/
pageIndex?: number | number;
/**
* This property accepts and returns a collection of feature object IDs. It is used to access and control which rows display a darker background, i.e., highlighted. Take note that highlighted rows are not considered selected as this property is independent of the table's selection state. Use the [highlightIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#highlightIds) property to choose rows. Setting `rowHighlightIds` applies an alternative highlight style to an entire row or rows.
*
* >
* > Use this property to highlight rows based on an event or action from another component (e.g. the view). For example, purposefully highlighting rows when hovering over a feature on the map or applying a "filter" via another widget to call out specific rows in the table. Generally, this property is not modified based on table events but rather an event or action from a different component.
*
* @since 4.30
* @example
* // This snippet adds an event listener which highlights (not selects) a row in the table
* // when a mouse pointer hovers over its corresponding row.
* featureTable.on("cell-pointerover", (event) => {
* // Add the event's feature to the rowHighlightIds collection if it's not already included
* if (!featureTable.rowHighlightIds.includes(event.objectId)) {
* featureTable.rowHighlightIds.push(event.objectId);
* }
* });
* // This snippet adds an event listener which removes the highlight from a row in the table
* // when a mouse pointer moves out of its corresponding row.
* featureTable.on("cell-pointerout", (event) => {
* // Remove the event's feature from the rowHighlightIds collection if it's included
* const index = featureTable.rowHighlightIds.indexOf(event.objectId);
* if (index > -1) {
* featureTable.rowHighlightIds.splice(index, 1);
* }
* });
*/
rowHighlightIds?: ReadonlyArrayOrCollection<ObjectId>;
/**
* A reference to top-level controller table. This property is applicable if this table is a related table, nested within and controlled by another table widget.
*
* @since 4.31
*/
tableController?: FeatureTable | null;
/**
* A reference to the instance of a table widget that is directly associated with this table. This only applies if this table is nested within another table widget. The parent table is responsible for creating this child table instance. The child table reacts to state changes on the parent table, including row selection.
*
* The parent table that this property references may also be nested, meaning it would refer to a different parent table. The top-level table can always be referenced via the [tableController](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#tableController) property. If only one nested table exists, then the values of [tableController](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#tableController) and `tableParent` are the same.
*
* @since 4.31
*/
tableParent?: FeatureTable | null;
/**
* The associated [template](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/) used for the feature table.
*
* The [TableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/) is where you configure how the feature table should display and set any associated properties for the table and its columns.
*
* > [!WARNING]
* >
* > The `TableTemplate` provides more fine-grained control over how the table is rendered within the 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. This property differs from the [attributeTableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#attributeTableTemplate) property as that property should be used to access the table's settings across different applications. By using [attributeTableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#attributeTableTemplate), the settings can be saved within a webmap or layer. Please refer to the [AttributeTableTemplate](https://developers.arcgis.com/javascript/latest/references/core/tables/AttributeTableTemplate/) and [TableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/TableTemplate/) documentation for more information.
*
* > [!WARNING]
* >
* > Take note that it is required to set the `type` property when creating column templates.
*
* @since
* 4.24
*
* > [!WARNING]
* >
* > Take note that it is required to set the `type` property when creating column templates.
* @example
* const tableTemplate = new TableTemplate({
* columnTemplates: [ // takes an array of FieldColumnTemplate and GroupColumnTemplate
* { // autocasts to FieldColumnTemplate
* type: "field", // This must be set when creating field column templates
* fieldName: "ObjectId",
* direction: "asc", // In order to use initialSortPriority, make sure direction is set
* initialSortPriority: 1 // This field's sort order takes the second-highest priority.
* },
* {
* type: "field",
* fieldName: "NAME",
* label: "Name",
* direction: "asc", // In order to use initialSortPriority, make sure direction is set
* initialSortPriority: 0 // This field's sort order takes the highest priority
* },
* {
* type: "field",
* fieldName: "STATUS",
* label: "Status",
* direction: "asc", // In order to use initialSortPriority, make sure direction is set
* initialSortPriority: 2 // This field's sort order is prioritized after Name and ObjectId, respectively.
* }]
* });
*/
tableTemplate?: TableTemplateProperties | null;
/**
* The [TimeExtent](https://developers.arcgis.com/javascript/latest/references/core/time/TimeExtent/) in which to filter and display data within the FeatureTable widget. Setting this property directly on the widget or its [viewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/FeatureTableViewModel/#timeExtent) takes precedence over the layer's [FeatureLayer.timeExtent](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#timeExtent). If this property is set directly on the widget, the table will not refresh when the layer's [TimeExtent](https://developers.arcgis.com/javascript/latest/references/core/time/TimeExtent/) changes.
*
* @since 4.30
* @see [FeatureLayer.timeExtent](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#timeExtent)
* @example
* // Filters the table to display only features that fit within the time extent
* reactiveUtils.watch(
* () => timeSlider.timeExtent,
* (extent) => {
* featureTable.timeExtent = extent;
* }
* );
*/
timeExtent?: TimeExtentProperties | null;
/** The view model for this widget. This is a class that contains all the logic, (ie. properties and methods), that controls the widget's behavior. See the [FeatureTableViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/FeatureTableViewModel/) class to access all properties and methods on the widget. */
viewModel?: FeatureTableViewModelProperties;
/**
* The visible elements that are displayed within the widget.
* This property provides the ability to turn individual elements of the widget's display on/off.
*/
visibleElements?: VisibleElementsProperties;
}
/** A custom function used to replace the title for the FeatureTable. This is useful in situations where it may be necessary to dynamically update titles based on the current state of the table. */
export type FeatureTableTitleFunction = () => string;
/** A custom function used to replace the description for the FeatureTable. This is useful in situations where it may be necessary to dynamically update descriptions based on the current state of the table. */
export type FeatureTableDescriptionFunction = () => string;
export interface FeatureTableEvents extends FeatureTableViewModelEvents {}
/**
* The FeatureTable's functionality is described in the following sections:
*
* * [Overview](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#overview)
* * [Selection and highlighting](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#selection)
* * [Filtering and sorting](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filtering-and-sorting)
* * [Editing within the FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#editing-in-featuretable)
* * [Related records](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#related-records)
* * [Configuring columns](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#column-configuration)
* * [Custom columns](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#custom-columns)
* * [Menu and menu items](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#menu-configuration)
*
* <span id="overview"></span>
* ## Overview
* The `FeatureTable` widget provides an interactive tabular view of each feature's attributes in a layer. In addition, it also works with standalone tables that are not associated with underlying geometries. The FeatureTable supports the following layer types:
*
* * [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/)
* * [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/)
* * [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/)
* * [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/) - Take note that it must have a mosaic dataset. Currently, `Map` and `FeatureTable` interaction with `ImageryLayers` are not supported.
* * [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/)
* * [SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/) (with an associated FeatureLayer)
* * [KnowledgeGraphSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/knowledgeGraph/KnowledgeGraphSublayer/)
* * [CatalogFootprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/)
* * [MapImageLayer.sublayers](https://developers.arcgis.com/javascript/latest/references/core/layers/MapImageLayer/#sublayers)
*
* The FeatureTable varies slightly from other widgets in that it can work independently of a map or scene view. This means that the FeatureTable can be used in a standalone application or in a view that does not contain a map or scene. However, if the FeatureTable is used in conjunction with a map or scene view, the view must be set on the FeatureTable in order for the [selection and highlighting](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#selection) to work. Implementing the FeatureTable programmatically is also slightly different than other widgets in that it is designed to be added to an application via its [container](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#container) element, as opposed to being added via the default UI, ie. `view.ui.add()`. The following example demonstrates how to add the FeatureTable to an application:
*
* ```javascript
* const featureTable = new FeatureTable({
* view: view,
* layer: featureLayer,
* container: "tableDiv"
* });
* ```
*
* The FeatureTable can be configured to display specific columns (including attachments), filter features, and sort columns. It provides the ability
* to [edit](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#editing-in-featuretable) feature attributes, [select and highlight](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#selection) features within the table and its associated view. In addition, it can also display and edit [related records](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#related-records). The latter beginning with version 4.30. The following sections provide more detail on how to configure and use the FeatureTable.
*
* <span id="selection"></span>
* ## Selection and highlighting
* The FeatureTable allows manual interaction or programmatic control over selecting and
* highlighting features within both the table and its associated view.
*
* To enable manual-driven selection and highlighting, ensure the table's [view](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#view) and [highlightEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#highlightEnabled) properties are configured.
* Once set, interacting with a table row will select and highlight the corresponding feature in the view.
* Multiple selections within the table are turned on by default. To update this behavior, set the [multipleSelectionEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#multipleSelectionEnabled) property to `false`.
*
* 
*
* <details>
* <summary>Read More</summary>
*
* If you wish to independently wire up selection and highlighting, set the
* table's [highlightIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#highlightIds). Modifying this collection by adding or removing feature object IDs
* will automatically update the selection status of the corresponding rows in the table. To deselect all
* features, simply clear the collection.
*
* Highlighting rows within the table can be accomplished using [rowHighlightIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#rowHighlightIds). This property allows for the visual differentiation of rows based on criteria such as specific values or edits, without affecting their selection status. For example, you can use it to highlight rows that contain a specific value or rows that have been edited.
*
* ```javascript
* // This snippet highlights rows within the table that have been edited.
* featureTable.layer.on("edits", (event) => {
* event.updatedFeatures.forEach((feature) => {
* featureTable.rowHighlightIds.push(feature.getObjectId());
* });
* });
* ```
* 
*
* Additionally, selection and highlight behavior can be enhanced using the feature table's [events](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#FeatureTableEvents). These events are designed to listen for cell interaction and include: [@cell-click](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#event-cell-click), [@cell-keydown](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#event-cell-keydown), [@cell-pointerout](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#event-cell-pointerout), and [@cell-pointerover](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#event-cell-pointerover). The latter two events are especially useful for tasks such as highlighting a feature in the view while hovering over a cell, all doing so without requiring the end-user to select the row. For example, these events can be used to display cell information in a tooltip that is attached to the mouse cursor.
*
* > In short, the [highlightIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#highlightIds) property is used to control and synchronize selections between the FeatureTable and other components of the SDK, whereas [rowHighlightIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#rowHighlightIds) is for adding a highlight to some rows, based on some other interaction within the application. It allows the ability to select specific rows based on actions performed in the application, such as hovering over a feature on the map or applying a filter through another widget.
*
* </details>
*
* <span id="filtering-and-sorting"></span>
* ## Filtering and sorting
* The FeatureTable provides the ability to filter and sort features within the table. A few different approaches to filtering are outlined in the section below.
*
* <details>
* <summary>Read More</summary>
*
* * **Filtering by selection**- By default, the table displays all rows, regardless of their selection status. However, if needing to display only selected rows, set the [filterBySelectionEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filterBySelectionEnabled) property to `true`. When set, the table will only display rows for selected features. This is useful for focusing on a specific subset of features. Setting the FeatureTable's [objectIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#objectIds) performs similar functionality where only the set object IDs will display within the table. If the collection is empty, all features display. The difference between [filterBySelectionEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filterBySelectionEnabled) and [objectIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#objectIds) is the latter does not require a selection. Rather, it only displays features with a matching object ID, whereas setting [filterBySelectionEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filterBySelectionEnabled) indicates to the table that it should only display features that are already selected. This selection is handled by passing in a collection of object IDs to the table's [highlightIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#highlightIds). Setting this property selects the corresponding features within the table while highlighting them in the view. For an example of how to filter using these properties, see the sample [FeatureTable with related records](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-relates/).
* * **Filtering by geometry**- This is done by setting the [filterGeometry](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filterGeometry) property to a geometry. When set, the table will only display rows for features that intersect the geometry. This is useful for focusing on a specific subset of features that intersect a geometry. See the samples, [FeatureTable with a map](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-map/), and [FeatureTable with related records](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-relates/)) for an example of how to filter features by geometry.
* * **Filtering by time**- To achieve this, configure the [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#timeExtent) property to a time extent. Once configured, the table will exclusively show rows corresponding to features that are within the defined time extent.
* **Filtering by selection and geometry**- This is accomplished by setting both the [objectIds](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#objectIds) and [filterGeometry](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filterGeometry) properties. When set, the table will only display rows for features that match the corresponding object ID and and intersect the geometry.
*
* It is possible to control sort order individually per column or on multiple columns. The latter is accomplished by setting the [multiSortEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#multiSortEnabled) property to `true`. When set, the table will allow sorting on multiple columns. The table's [sortColumn()](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#sortColumn) method is used to sort columns. This method takes the field name and sort order as parameters. The sort order can be set to either `asc` or `desc`. The priority of columns and their sort order can be set using [FieldColumnTemplate.initialSortPriority](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/#initialSortPriority). This property is used to set the initial sort priority for a column.
*
* > [!WARNING]
* >
* > If the table is in its default sort mode with no initial sort order provided, the first field on the layer automatically sorts in ascending order.
*
* </details>
*
* <span id="editing-in-featuretable"></span>
* ## Editing within the FeatureTable
* The FeatureTable provides the ability to edit feature attributes within the table. This is accomplished by setting the [editingEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#editingEnabled) property to `true`. The editing experience is similar to that of a spreadsheet, where end-users can click into a cell to edit its value. The table automatically saves edits to the layer once navigating away from the cell or `Enter` is pressed. Press the `Esc` key to cancel an edit. The FeatureTable also provides the ability to delete selected records. This is done by selecting the rows to delete and clicking the `Delete Selection` menu item. The `Delete Selection` menu item is only available if the [editingEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#editingEnabled) property is set to `true` and the feature service supports editing.
*
* 
*
* <details>
* <summary>Read More</summary>
*
* Editing permissions can be separated into the following levels of priority:
* * [FeatureLayer.editingEnabled](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#editingEnabled) - This is derived from the layer's [FeatureLayer.editingEnabled](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#editingEnabled) property. This must always be `true` for editing to be enabled.
* * [Field](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/) - This is derived from the [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/). It takes what is set in the [Field.editable](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#editable)
* property. This must always be `true` for editing to be enabled, although it can be overridden to `false` (not
* vice-versa) via a [field column template](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/#editable).
* * [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) - The [editingEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#editingEnabled) property must be set on the table in order for any type of editing to be enabled.
* * [Template](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/#editable) - The editable permissions on a field can be configured by setting the [FieldColumnTemplate.editable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/#editable) property of the [FieldColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/).
*
* > [!WARNING]
* >
* > If the service's field is not editable, it is not possible to override its permissions using any of the options above. [FieldColumnTemplate.editable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/#editable) can never override what is set on the layer, field, or table.
* > Editing is disabled for big integer fields that contain a value that falls outside of the max and min whole number threshold of -9007199254740991 and 9007199254740991. Any attempts to edit value higher or lower than these thresholds will not work and those edits will not be saved.
* > An Object ID field is required for editing to work.
*
* </details>
*
* <span id="related-records"></span>
* ## Related records
* Beginning with version 4.30, the FeatureTable supports the ability to display and edit related records within the table.
*
* | Origin table with related records |
* |---------------------------------- |
* |  |
*
* | Destination table with related records |
* |-----------------------------------|
* |  |
*
* This is done by setting the [relatedRecordsEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#relatedRecordsEnabled) property to `true`. When this property is set, the table will contain a field that links to any related records associated with each feature in the table. When clicked, a separate table displays the related records for that feature. The FeatureTable provides the ability to show nested related records, which are related records that contain their own related records. It automatically recognizes if there are any related tables associated a table and, if applicable, displays links to related records for that feature or row. The following example demonstrates how to configure the FeatureTable to display related records:
*
* ```javascript
* const featureTable = new FeatureTable({
* view: view,
* layer: featureLayer,
* relatedRecordsEnabled: true,
* container: "tableDiv"
* });
* ```
* <details>
* <summary>Read More</summary>
*
* The main difference with how related records work in comparison to the Editor widget is that the FeatureTable does not have to have a template configured with relationship information for it to be recognized and automatically picked up within the table. In order for related data to display within the table, the [relatedRecordsEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#relatedRecordsEnabled) property must be set to `true`, the origin table must have an associated relationship class, and its related data must also be contained within the map. If these conditions are met, any related records associated with the table's features will automatically display with embedded links to its related data. The FeatureTable also provides the ability to show nested related records, which are related records that contain their own related records. This is useful for displaying complex relationships within the table.
*
* There are a couple of known limits when working with relationships in the FeatureTable:
*
* * Displaying and editing related records is only supported using ArcGIS Online and ArcGIS Enterprise version 11.2 or higher feature services.
* * Editing related records is only supported if the related table is editable.
* * The related layers or tables must also be added to the map to be able to display related records within the table.
*
* </details>
*
* <span id="column-configuration"></span>
* ## Configuring columns
* The FeatureTable provides various column types that can be configured to display within the table.
*
* These column types include:
* * `column` ([Column](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/Grid/Column/)) - This is the column type that supports the underlying functionality for the various column types listed below. Use this column type to create custom columns that display within the table and are not directly tied to data within a layer.
* * `field` ([FieldColumn](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/FieldColumn/)) - This is the column type that displays the field name and value within the table. This column type is the type used to display the field name and value for features within the table.
* * `action` ([ActionColumn](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/ActionColumn/)) - This is the column type that displays [action](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#actionColumnConfig) buttons within the table.
* * `relationship` ([RelationshipColumn](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/RelationshipColumn/)) - This is the column type that displays [related records](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#related-records) within the table.
* * `attachment` ([AttachmentsColumn](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/AttachmentsColumn/)) - This is the column type that displays [attachments](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#attachmentsEnabled) within the table. Take note that viewing attachments directly within the table's cell is not supported, although if a feature contains attachments, the total count per feature will display.
* * `group` ([GroupColumn](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/Grid/GroupColumn/)) - This is the column type that groups columns within the table.
*
* <details>
* <summary>Read More</summary>
*
* These column classes contain information about the current table state. And although it is possible to interact directly with these columns, ie. updating properties, calling methods, etc., the recommended approach is to set the [tableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#tableTemplate) with configured column templates prior to table creation. The reason for this is because templates are designed to help configure columns prior to table creation and therefore wil not update based on the table's underlying state changes.
*
* At version 4.30, the FeatureTable's API has been improved to not regenerate columns unless in only very necessary cases, e.g. setting an entirely new [tableTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#tableTemplate) and forcing the table to refresh. Although this approach is supported, it may not be necessary as it is possible to directly interact with the underlying columns and not cause unnecessary re-renders.
*
* The column configuration of the FeatureTable is designed to be flexible, providing a rich user experience. While it is generally recommended to update the corresponding template when changes are made to a column's property, it is not mandatory if there is no need to regenerate columns forcefully.
*
* > [!WARNING]
* >
* > There are some properties pertaining to width and alignment that may not function as expected if modified dynamically.
*
* * The [ColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/ColumnTemplate/) class can be used to create and configure custom columns that display within the table.
* * The [FieldColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/FieldColumnTemplate/) class is tied to a layer and is used to configure and display field names and values within the table.
* * Lastly, the [GroupColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/GroupColumnTemplate/) class is used to configure grouped columns within the table. Each template contains the field name, label, and other properties that define the column's behavior. The following example demonstrates how to configure the field columns within the FeatureTable's table template:
*
* ```javascript
* const featureTable = new FeatureTable({
* view: view,
* layer: featureLayer,
* tableTemplate: ({ // autocastable to table template
* columnTemplates: [{
* type: "field", // autocastable to field column template
* fieldName: "field1",
* label: "Field 1"
* },
* {
* type: "field",
* fieldName: "field2",
* label: "Field 2"
* }]
* }),
* container: "tableDiv"
* });
* ```
* The template classes are designed primarily to configure columns prior to table creation. Once the table is created, the templates will not update based on state changes. The underlying column classes have information about the current table state.
*
* </details>
*
* <span id="custom-columns"></span>
* ### Custom columns
* Beginning with version 4.30, support for custom columns, ie. virtual columns, was added. Custom columns can be configured and displayed by leveraging the [ColumnTemplate](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/ColumnTemplate/) class. The following example demonstrates how to create a custom column that displays a rating of stars within the table based on a feature's rating. It does so using a calcite component that displays the rating as stars. In addition, it makes use of the column template's [ColumnTemplate.formatFunction](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/ColumnTemplate/#formatFunction) property. This function is useful as it allows for dynamic content to be displayed within the table's cell and provides a way to add a rich user ex