FeatureTable

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

This widget provides an interactive tabular view of each feature's attributes in a feature layer. In addition, it also works with standalone tables that are not associated with underlying geometries. When working with a large dataset, the table loads additional features as the user scrolls.

Known Limitations

  • Number and date formatting is not yet supported but will be added in a future release.
  • Viewing and editing related records is currently not supported. If this functionality is needed, please use the Editor widget. This functionality is planned for a future release.
  • Viewing attachments directly within the table's cell is not supported, although if a feature contains attachments, the total count per feature will display.
  • SceneLayers are only supported if they have an associated FeatureLayer.
  • 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.
  • Date and time field behavior is detailed below under the timeZone documentation.

The following image displays the standalone FeatureTable widget without any associated map.

standalone featuretable widget

The following image displays the FeatureTable widget with an associated map.

standalone featuretable widget

For information about gaining full control of widget styles, see the Styling topic.
See also

Constructors

FeatureTable

Constructor
new FeatureTable(properties)
Parameter
properties Object
optional

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

Example
// Typical usage for the FeatureTable widget. This will recognize all fields in the layer if none are set.
const featureTable = new FeatureTable({
  view: view, // The view property must be set for the select/highlight to work
  layer: featureLayer,
  container: "tableDiv" // the table must be assigned to the container via 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
Collection<(GeometryFilter|SelectionFilter)>

A read-only property indicating the type of filter used by the table.

FeatureTable
ColumnSortOrder[]

Use this read-only property if needing to query features while retaining a column's sort order.

FeatureTable
Boolean

Indicates whether to display the Attachments field in the table.

FeatureTable
Boolean

Automatically refreshes the table when its associated layer has been updated.

FeatureTable
Boolean

When true, columns can be reordered by dragging a column's header.

FeatureTable
Collection<(FieldColumn|GroupColumn)>

A read-only collection of field columns and/or grouped field columns within the table.

FeatureTable
String|HTMLElement

The ID or node representing the DOM element containing the widget.

FeatureTable
String

The name of the class.

Accessor
Boolean

Indicates whether editing is enabled on the data within the feature table.

FeatureTable
Geometry

Set this property to filter the features displayed in the table.

FeatureTable
Collection<string>

A collection of string field.names that are to remain hidden within the table.

FeatureTable
Boolean

Indicates whether to highlight the associated feature when a row is selected.

FeatureTable
Collection<number>

This property accepts and returns a collection of feature ObjectId's.

FeatureTable
Boolean

Indicates whether to highlight the associated feature when a row is selected.

FeatureTable
String

The unique ID assigned to the widget when the widget is created.

Widget
String

The widget's default label.

FeatureTable
FeatureLayer|SceneLayer|GeoJSONLayer|CSVLayer|WFSLayer|ImageryLayer

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

FeatureTable
ButtonMenu

Reference to the FeatureTable's menu.

FeatureTable
ButtonMenuConfig

Set this object to customize the feature table's menu content.

FeatureTable
Boolean

Indicates whether sorting multiple columns is supported within the table.

FeatureTable
Number

The default page size used when displaying features within the table.

FeatureTable
Boolean

Indicates whether to fetch geometries for the corresponding features displayed in the table.

FeatureTable
String

The state of the widget.

FeatureTable
TableTemplate

The associated template used for the feature table.

FeatureTable
String

Dates and times displayed in the widget will be in terms of this time zone.

FeatureTable
MapView|SceneView

A reference to the MapView or SceneView.

FeatureTable
FeatureTableViewModel

The view model for this widget.

FeatureTable
Boolean

Indicates whether the widget is visible.

Widget
VisibleElements

The visible elements that are displayed within the widget.

FeatureTable

Property Details

activeFilters

Property
activeFilters Collection<(GeometryFilter|SelectionFilter)>readonly

A read-only property indicating the type of filter used by the table. It returns either filters by geometry or selections using a row's ObjectId.

activeSortOrders

Property
activeSortOrders ColumnSortOrder[]readonly
Since: ArcGIS Maps SDK for JavaScript 4.25 FeatureTable since 4.15, activeSortOrders added at 4.25.

Use this read-only property if needing to query features while retaining a column's sort order. It returns an array of ColumnSortOrder. This contains a column's name and its sort direction. The sort priority is honored in the returned ColumnSortOrder if multiSortEnabled is true with a set initialSortPriority.

Default Value:[]

attachmentsEnabled

Property
attachmentsEnabled Boolean

Indicates whether to display the Attachments field in the table. This is only applicable if the feature layer supports attachments. Currently, this field only displays the count of attachments per feature.

featuretable attachmentsEnabled

Default Value:false

autoRefreshEnabled

Property
autoRefreshEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.23 FeatureTable since 4.15, autoRefreshEnabled added at 4.23.

Automatically refreshes the table when its associated layer has been updated.

Default Value:true

columnReorderingEnabled

Property
columnReorderingEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, columnReorderingEnabled added at 4.16.

When true, columns can be reordered by dragging a column's header.

Default Value:true

columns

Property
columns Collection<(FieldColumn|GroupColumn)>autocastreadonly
Autocasts from Object[]

A read-only collection of field columns and/or grouped field columns 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. In this case, it is also required that the column template's visible property is set to true.

See also

container

Property
container String|HTMLElement

The ID or node representing the DOM element containing the widget. This property can only be set once. The snippets below provide some examples for setting this.

The FeatureTable widget's container property must be set within its constructor and not via the view.ui.add() method.

Examples
// 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")
});
// 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>

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

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

editingEnabled

Property
editingEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, editingEnabled added at 4.16.

Indicates whether editing is enabled on the data within the feature table. Double-clicking in a cell will enable editing for that value.

Editing permissions can be broken down with the following levels of priority:

  1. Field - This is derived from the FeatureLayer. 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 on 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 to true. In contrast to this, if a table has editing enabled, setting a field column template's editable property to false can disable editing for a specific column.

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

featuretable editing

Default Value:false
See also

filterGeometry

Property
filterGeometry Geometryautocast
Since: ArcGIS Maps SDK for JavaScript 4.19 FeatureTable since 4.15, filterGeometry added at 4.19.

Set this property to filter the features displayed in the table. It accepts a Geometry, e.g. Extent, and uses it as a spatial filter. When modifying this property, the FeatureTable will completely refresh and re-query for all features.

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 });

hiddenFields

Property
hiddenFields Collection<string>
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, hiddenFields added at 4.16.

A collection of string field.names that are to remain 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. In this case, it is also required that the column template's visible property is set to true.

Default Value:true
See also
Examples
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")
});
// 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")
});

highlightEnabled

Property
highlightEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.25 FeatureTable since 4.15, highlightEnabled added at 4.25.

Indicates whether to highlight the associated feature when a row is selected.

Default Value:true

highlightIds

Property
highlightIds Collection<number>
Since: ArcGIS Maps SDK for JavaScript 4.25 FeatureTable since 4.15, highlightIds added at 4.25.

This property accepts and returns a collection of feature ObjectId's. 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 ObjectId's, the table will select the corresponding row and highlight its feature within the map.

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);
});

highlightOnRowSelectEnabled

Property
highlightOnRowSelectEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, highlightOnRowSelectEnabled added at 4.16.
Deprecated since version 4.25. Use highlightEnabled instead.

Indicates whether to highlight the associated feature when a row is selected.

Default Value:true

id

Inherited
Property
id String
Inherited from Widget

The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the container ID, or if that is not present then it will be automatically generated.

label

Property
label String

The widget's default label.

The associated FeatureLayer, SceneLayer, GeoJSONLayer, CSVLayer, ImageryLayer, or WFSLayer containing the fields and attributes to display within the widget. The table's pagination defaults to 50 records at a time. If the layer contains less than 50 records, it will use whatever count it has. Note that 0 records do not apply.

See also
Property
menu ButtonMenureadonly
Since: ArcGIS Maps SDK for JavaScript 4.19 FeatureTable since 4.15, menu added at 4.19.

Reference to the FeatureTable's menu.

The menu's items are regenerated when a column's visibility changes. Use the FeatureTable's menuConfig and menuConfig.items to customize menu items. These options are recommended, rather than updating The table's items directly off of its menu. This helps ensure the menu always shows the correct items.

Property
menuConfig ButtonMenuConfig
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, menuConfig added at 4.16.

Set this object to customize the feature table's menu content.

multiSortEnabled

Property
multiSortEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.23 FeatureTable since 4.15, multiSortEnabled added at 4.23.

Indicates whether sorting multiple columns is supported within the table. Use this in combination with the FieldColumnTemplate.initialSortPriority and FieldColumnTemplate.direction properties to set sorting functionality for multiple columns.

Example
const featureTableVM = new FeatureTableViewModel({
  layer: featureLayer,
  multiSortEnabled: true,
  tableTemplate: { // autocasts to TableTemplate
    columnTemplates: [ // takes an array of FieldColumnTemplate and GroupColumnTemplate
    { // autocasts to FieldColumnTemplate
      type: "field",
      fieldName: "ObjectId",
      direction: "asc", // In order to use initialSortPriority, make sure direction is set
      initialSortPriority: 1, // This field's sort order takes second-highest priority.
    },
    {
      type: "field",
      fieldName: "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",
      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.
    }]
  },
  container: "tableDiv"
});

pageSize

Property
pageSize Number
Since: ArcGIS Maps SDK for JavaScript 4.19 FeatureTable since 4.15, pageSize added at 4.19.

The default page size used when displaying features within the table. By default, the page loads the first 50 features returned by the service.

It is not possible to overwrite the maximum page size on the server, ie. maxRecordCount, as this property only applies to set values less than the maximum page size, i.e. maxRecordCount, set on the service.

returnGeometryEnabled

Property
returnGeometryEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.27 FeatureTable since 4.15, returnGeometryEnabled added at 4.27.

Indicates whether to fetch geometries for the corresponding features displayed in the table. NOTE: Setting this to true can impact performance of the widget.

Default Value:false

state

Property
state Stringreadonly

The state of the widget.

Possible Values:"disabled"|"loading"|"loaded"|"ready"

Default Value:disabled

tableTemplate

Property
tableTemplate TableTemplate
Since: ArcGIS Maps SDK for JavaScript 4.24 FeatureTable since 4.15, tableTemplate added at 4.24.

The associated template used for the feature table.

The tableTemplate is where you configure how the feature table should display and set any associated properties for the table and its columns.

Example
const tableTemplate = new TableTemplate({
  columnTemplates: [ // takes an array of FieldColumnTemplate and GroupColumnTemplate
  { // autocasts to FieldColumnTemplate
    type: "field",
    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.
   }]
});

timeZone

Property
timeZone String
Since: ArcGIS Maps SDK for JavaScript 4.28 FeatureTable since 4.15, timeZone added at 4.28.

Dates and times displayed in the widget will be in terms of this time zone. If not supplied, the view's time zone is used (if available). Depending on the field type, individual columns may have their own unique time zone behavior when the time zone itself is unknown.

The following considerations apply when working with date, time, and big integer field types:

  • By default, the FeatureTable displays timezones for date and timestamp-offset field types reflecting the MapView's timezone. This timezone can be overridden by setting the table's timezone property.
  • If the table's view isn't set, and the table's esri/widgets/Feature#timeZone timeZone isn't set, the table defaults to system time. The only time that this is not the case is when there is a preferredTimeZone set on the table's layer. If the latter is true, the preferred time zone is used as opposed to system.

view

Property
view MapView|SceneView

A reference to the MapView or SceneView. This property must be set for select/highlighting in the map to work.

viewModel

Property
viewModel FeatureTableViewModelautocast

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 class to access all properties and methods on the widget.

visible

Inherited
Property
visible Boolean
Inherited from Widget

Indicates whether the widget is visible.

If false, the widget will no longer be rendered in the web document. This may affect the layout of other elements or widgets in the document. For example, if this widget is the first of three widgets associated to the upper right hand corner of the view UI, then the other widgets will reposition when this widget is made invisible. For more information, refer to the css display value of "none".

Default Value:true
Example
// Hides the widget in the view
widget.visible = false;

visibleElements

Property
visibleElements VisibleElements

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.

Example
// Default values are displayed below
featureTable.visibleElements = {
  header: true,
  menu: true,
  menuItems: {
    clearSelection: true,
    deleteSelection: true, // Works if the layer supports deletion and editingEnabled property is true
    refreshData: true,
    toggleColumns: true,
    selectedRecordsShowAllToggle: true,
    selectedRecordsShowSelectedToggle: true,
    zoomToSelection: true
  },
  selectionColumn: true,
  columnMenus: true
}

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
String

A utility method used for building the value for a widget's class property.

Widget

Clears the current selection within the table.

FeatureTable

Clears the current selection filter within the table.

FeatureTable
Promise<void>

Deletes all the selected rows from the table.

FeatureTable

Unselects the specified rows within the table.

FeatureTable

Destroys the widget instance.

Widget
Boolean

Emits an event on the instance.

Widget

Filters the table by the current selection.

FeatureTable
Column|GroupColumn

Finds the specified column within the feature table.

FeatureTable
Boolean

Indicates whether there is an event listener on the instance that matches the provided event name.

Widget
Boolean

Returns true if a named group of handles exist.

Accessor

Hides the specified column from the feature table.

FeatureTable
Boolean

isFulfilled() may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected).

Widget
Boolean

isRejected() may be used to verify if creating an instance of the class is rejected.

Widget
Boolean

isResolved() may be used to verify if creating an instance of the class is resolved.

Widget
Object

Registers an event handler on the instance.

Widget

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

Widget

This method is primarily used by developers when implementing custom widgets.

Widget
Promise<void>

Refreshes the table contents while maintaining the current scroll position.

FeatureTable

Removes a group of handles owned by the object.

Accessor
Object

This method is primarily used by developers when implementing custom widgets.

Widget

Renders widget to the DOM immediately.

Widget

This method is primarily used by developers when implementing custom widgets.

Widget

Scrolls the table to a row based on a specified index.

FeatureTable

Selects the specified rows within the table.

FeatureTable

Shows all of the columns in the table.

FeatureTable

Shows the specified column within the feature table.

FeatureTable

Sorts the column in either ascending ("asc") or descending ("desc") order.

FeatureTable
Promise

when() may be leveraged once an instance of the class is created.

Widget

Zooms the view to the extent of the current row selection.

FeatureTable

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.

classes

Inherited
Method
classes(classNames){String}
Inherited from Widget

A utility method used for building the value for a widget's class property. This aids in simplifying css class setup.

Parameter
classNames String|String[]|Object
repeatable

The class names.

Returns
Type Description
String The computed class name.
Example
// .tsx syntax showing how to set css classes while rendering the widget

render() {
  const dynamicIconClasses = {
    [css.myIcon]: this.showIcon,
    [css.greyIcon]: !this.showIcon
  };

  return (
    <div class={classes(css.root, css.mixin, dynamicIconClasses)} />
  );
}

clearSelection

Method
clearSelection()
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, clearSelection added at 4.16.
Deprecated since version 4.25. Use highlightIds.removeAll() instead.

Clears the current selection within the table.

clearSelectionFilter

Method
clearSelectionFilter()
Since: ArcGIS Maps SDK for JavaScript 4.23 FeatureTable since 4.15, clearSelectionFilter added at 4.23.

Clears the current selection filter within the table.

deleteSelection

Method
deleteSelection(showWarningPrompt){Promise<void>}
Since: ArcGIS Maps SDK for JavaScript 4.25 FeatureTable since 4.15, deleteSelection added at 4.25.

Deletes all the selected rows from the table.

There must be at least one selected row within the table for this to work. Also, make sure that editingEnabled is set to true and the underlying service data supports deletion.

Parameter
showWarningPrompt Boolean
optional

Indicates whether to display a prompt warning that the selected features will be deleted. Default behavior is to show a warning dialog before proceeding.

Returns
Type Description
Promise<void> Resolves when the selection is deleted.

deselectRows

Method
deselectRows(params)
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, deselectRows added at 4.16.
Deprecated since 4.25. Use highlightIds.remove() instead.

Unselects the specified rows within the table.

Parameter

The selection parameters to deselect within the feature table.

destroy

Inherited
Method
destroy()
Inherited from Widget

Destroys the widget instance.

emit

Inherited
Method
emit(type, event){Boolean}
Inherited from Widget

Emits an event on the instance. This method should only be used when creating subclasses of this class.

Parameters
type String

The name of the event.

event Object
optional

The event payload.

Returns
Type Description
Boolean true if a listener was notified

filterBySelection

Method
filterBySelection()
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, filterBySelection added at 4.16.

Filters the table by the current selection.

findColumn

Method
findColumn(fieldName){Column|GroupColumn}
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, findColumn added at 4.16.

Finds the specified column within the feature table.

Parameter
fieldName String

The fieldName of the column to find.

Returns
Type Description
Column | GroupColumn The returned column.

hasEventListener

Inherited
Method
hasEventListener(type){Boolean}
Inherited from Widget

Indicates whether there is an event listener on the instance that matches the provided event name.

Parameter
type String

The name of the event.

Returns
Type Description
Boolean Returns true if the class supports the input event.

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");
}

hideColumn

Method
hideColumn(fieldName)
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, hideColumn added at 4.16.

Hides the specified column from the feature table.

Parameter
fieldName String

The fieldName of the column to hide.

isFulfilled

Inherited
Method
isFulfilled(){Boolean}
Inherited from Widget
Since: ArcGIS Maps SDK for JavaScript 4.19 Widget since 4.2, isFulfilled added at 4.19.

isFulfilled() may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled, true will be returned.

Returns
Type Description
Boolean Indicates whether creating an instance of the class has been fulfilled (either resolved or rejected).

isRejected

Inherited
Method
isRejected(){Boolean}
Inherited from Widget
Since: ArcGIS Maps SDK for JavaScript 4.19 Widget since 4.2, isRejected added at 4.19.

isRejected() may be used to verify if creating an instance of the class is rejected. If it is rejected, true will be returned.

Returns
Type Description
Boolean Indicates whether creating an instance of the class has been rejected.

isResolved

Inherited
Method
isResolved(){Boolean}
Inherited from Widget
Since: ArcGIS Maps SDK for JavaScript 4.19 Widget since 4.2, isResolved added at 4.19.

isResolved() may be used to verify if creating an instance of the class is resolved. If it is resolved, true will be returned.

Returns
Type Description
Boolean Indicates whether creating an instance of the class has been resolved.

on

Inherited
Method
on(type, listener){Object}
Inherited from Widget

Registers an event handler on the instance. Call this method to hook an event with a listener.

Parameters

An event or an array of events to listen for.

listener Function

The function to call when the event fires.

Returns
Type Description
Object Returns an event handler with a remove() method that should be called to stop listening for the event(s).
Property Type Description
remove Function When called, removes the listener from the event.
Example
view.on("click", function(event){
  // event is the event handle returned after the event fires.
  console.log(event.mapPoint);
});

own

Inherited
Method
own(handleOrHandles)
Inherited from Widget
Since: ArcGIS Maps SDK for JavaScript 4.24 Widget since 4.2, own added at 4.24.
Deprecated since 4.28 Use addHandles() instead.

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

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

this.own(handle); // Handle gets removed when the widget is destroyed.
Parameter
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the widget is destroyed.

postInitialize

Inherited
Method
postInitialize()
Inherited from Widget

This method is primarily used by developers when implementing custom widgets. Executes after widget is ready for rendering.

refresh

Method
refresh(){Promise<void>}
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, refresh added at 4.16.

Refreshes the table contents while maintaining the current scroll position.

Returns
Type Description
Promise<void> Resolves when the table finishes refreshing.

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");

render

Inherited
Method
render(){Object}
Inherited from Widget

This method is primarily used by developers when implementing custom widgets. It must be implemented by subclasses for rendering.

Returns
Type Description
Object The rendered virtual node.

renderNow

Inherited
Method
renderNow()
Inherited from Widget

Renders widget to the DOM immediately.

scheduleRender

Inherited
Method
scheduleRender()
Inherited from Widget

This method is primarily used by developers when implementing custom widgets. Schedules widget rendering. This method is useful for changes affecting the UI.

scrollToIndex

Method
scrollToIndex(index)
Since: ArcGIS Maps SDK for JavaScript 4.19 FeatureTable since 4.15, scrollToIndex added at 4.19.

Scrolls the table to a row based on a specified index.

Parameter
index Number

Index of the row in which the table should scroll.

selectRows

Method
selectRows(params)
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, selectRows added at 4.16.
Deprecated since 4.25. Use highlightIds.add() instead.

Selects the specified rows within the table.

Parameter

The selection parameters to select within the feature table.

showAllColumns

Method
showAllColumns()
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, showAllColumns added at 4.16.

Shows all of the columns in the table.

showColumn

Method
showColumn(fieldName)
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, showColumn added at 4.16.

Shows the specified column within the feature table.

Parameter
fieldName String

The fieldName of the column to show.

sortColumn

Method
sortColumn(path, direction)
Since: ArcGIS Maps SDK for JavaScript 4.16 FeatureTable since 4.15, sortColumn added at 4.16.

Sorts the column in either ascending ("asc") or descending ("desc") order.

Parameters
path String

The specified field name to sort.

direction String

The direction to sort.

Possible Values:"asc"|"desc"

when

Inherited
Method
when(callback, errback){Promise}
Inherited from Widget
Since: ArcGIS Maps SDK for JavaScript 4.19 Widget since 4.2, when added at 4.19.

when() may be leveraged once an instance of the class is created. This method takes two input parameters: a callback function and an errback function. The callback executes when the instance of the class loads. The errback executes if the instance of the class fails to load.

Parameters
callback Function
optional

The function to call when the promise resolves.

errback Function
optional

The function to execute when the promise fails.

Returns
Type Description
Promise Returns a new promise for the result of callback.
Example
// Although this example uses the BasemapGallery widget, any class instance that is a promise may use when() in the same way
let bmGallery = new BasemapGallery();
bmGallery.when(function(){
  // This function will execute once the promise is resolved
}, function(error){
  // This function will execute if the promise is rejected due to an error
});

zoomToSelection

Method
zoomToSelection()
Since: ArcGIS Maps SDK for JavaScript 4.23 FeatureTable since 4.15, zoomToSelection added at 4.23.

Zooms the view to the extent of the current row selection. This can also be triggered as a menu item within the table. This item will display if at least one row is selected and the view is set on the FeatureTable.

Type Definitions

ButtonMenuConfig

Type Definition
ButtonMenuConfig

The configurable options to customize either the feature table or column menu via the menuConfig property.

Properties
container HTMLElement
optional

The DOM Element containing the menu.

iconClass String
optional

Adds a CSS class to the menu button's DOM node.

optional

An array of ButtonMenuItems.

open Boolean
optional

Indicates if the menu content is visible. Default is false.

optional

The associated viewModel for the ButtonMenu.

See also

ButtonMenuItemConfig

Type Definition
ButtonMenuItemConfig

The configurable options to customize either the feature table or column menu via the menuConfig item property.

Properties
autoCloseMenu Boolean
optional

Indicates whether to automatically close the menu's item.

optional

A function that executes on the ButtonMenuItem's click event.

iconClass String
optional

Adds a CSS class to the menu button's DOM node.

optional

An array of individual menu items.

label String
optional

The label of the menu item. This can be used in conjunction with the iconClass property.

open Boolean
optional

Indicates if the menu content is visible.

selectionEnabled Boolean
optional

Indicates whether a toggled state should be applied to individual menu items.

selected Boolean
optional

Indicates whether the menu item is selected.

See also

VisibleElements

Type Definition
VisibleElements

The visible elements that are displayed within the widget. This provides the ability to turn individual elements of the widget's display on/off.

Properties
header Boolean
optional

Indicates whether to display the feature table's header information. Default value is true.

menu Boolean
optional

Indicates whether to display the feature table's menu. Default value is true.

selectionColumn Boolean
optional

Indicates whether to display the selection column in the table. Each row has a checkbox that selects its corresponding feature. Default value is true. If working with a map, make certain to set the FeatureTable.view property as this enables highlighting the corresponding feature.

columnMenus Boolean
optional

(Since 4.23) Indicates whether to display the menu items within the individual columns. Default value is true.

menuItems Object
optional

The menu items within the feature table menu.

Specification
clearSelection Boolean
optional

Indicates whether to display the Clear selection menu item. Default value is true and will display within the menu if any rows are selected.

deleteSelection Boolean
optional

(Since 4.25) Indicates whether to display the Delete Selection menu item. Default value is true and will display if editingEnabled is true and enabled on the feature service and rows are selected.

refreshData Boolean
optional

Indicates whether to display the Refresh data menu item. Default value is true.

selectedRecordsShowAllToggle Boolean
optional

(Since 4.23) Indicates whether to toggle between showing only selected records in the table to showing all of the records. Default value is true.

selectedRecordsShowSelectedToggle Boolean
optional

(Since 4.23) Indicates whether to display the Show selected records menu item. Default value is true and will display within the menu if any rows are selected.

toggleColumns toggleColumns
optional

Indicates whether to enable toggling column visibility within the menu. Default value is true.

zoomToSelection zoomToSelection
optional

(Since 4.23) Indicates whether to display the Zoom to selected menu item. Default value is true and will display within the menu if any rows are selected.

Event Overview

Name Type Summary Class
{added: Object[],added.feature: Graphic,added.attachments: AttachmentInfo[],added.objectId: Number,added.relatedRecords: Graphic[],removed: Object[],removed.feature: Graphic,removed.attachments: AttachmentInfo[],removed.objectId: Number,removed.relatedRecords: Graphic[]}

Fires when a row selection is added and/or removed within the FeatureTable.

FeatureTable

Event Details

selection-change

Event
selection-change
Deprecated since version 4.25. Listen for changes on highlightIds instead.

Fires when a row selection is added and/or removed within the FeatureTable. This functionality can also be achieved by listening for changes on the highlightIds collection.

Properties
added Object[]

An array of objects containing row (feature) data added to the table selection.

Specification
feature Graphic

The associated row (feature) added to the feature table selection.

attachments AttachmentInfo[]

If applicable, an array of AttachmentInfo associated with the row (feature) added to the feature table selection.

objectId Number

The objectId associated with the added item.

relatedRecords Graphic[]

(Currently not implemented). If applicable, an array of related features associated with the row (feature) added to the feature table selection.

removed Object[]

An array of objects containing row (feature) data removed in the table selection.

Specification
feature Graphic

The associated row (feature) removed from the feature table selection.

attachments AttachmentInfo[]

If applicable, an array of AttachmentInfo associated with the row (feature) removed from the feature table selection.

objectId Number

The objectId associated with the removed item.

relatedRecords Graphic[]

(Currently not implemented). If applicable, an array of related features associated with the row (feature) removed from the feature table selection.

Example
// This function will fire each time a row (feature) is either added
// or removed from the feature table's selection
featureTable.on("selection-change", (event) => {
  let addedRows = event.added; // An array of features added to the selection
  let removedRows = event.removed;  // An array of features removed from the selection
});

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