Skip to content
ESM
import "@arcgis/map-components/components/arcgis-table-list";
Inheritance:
ArcgisTableListPublicLitElement
Since
ArcGIS Maps SDK for JavaScript 4.28

The Table List component provides a way to display a list of tables associated with a Map. It is meant to be used with feature layer tables.

If a map contains feature layer tables, they will display within the component. Tables can also be added to the Map's tables collection. Any tables referenced in the map property will display in the component. If unsure of whether the layer is a table, check the feature layer's isTable property.

The ListItem API provides access to each table, allows the developer to configure actions related to the table, and allows the developer to add content to the item related to the table.

Known Limitations

  • The TableList component is not supported with arcgis-scene.

Demo

Example
const tableListElement = document.createElement("arcgis-table-list");
tableListElement.referenceElement = viewElement;
tableListElement.slot = "top-left";
viewElement.appendChild(tableListElement);
const layer = Layer.fromPortalItem({
// Loads a layer (table) from a portal item
portalItem: {
id: "add portal item id"
}
});
// Wait for the layer to load
await layer.load()
// Check if the layer is a table
if (layer.isTable) {
// Add the table to the map's tables collection
viewElement.map.tables.add(layer);
}

Properties

PropertyAttributeType
auto-destroy-disabled
closed
collapsed
reflected
collapsed
drag-enabled
filter-placeholder
filter-text
hide-status-indicators
icon
Icon["icon"]
label
map
min-drag-enabled-items
min-filter-items
reference-element
selection-mode
"multiple" | "single" | "none" | "single-persist"
show-close-button
show-collapse-button
show-errors
show-filter
show-heading
show-temporary-table-indicators
state
readonly
tableItems
readonly

autoDestroyDisabled

Property
Type
boolean

If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy() method when you are done to prevent memory leaks.

Attribute
auto-destroy-disabled
Default value
false

closed

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 4.33

Indicates whether a component is closed. When true, the component will be hidden.

Attribute
closed
Default value
false

collapsed

reflected Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 4.29

Indicates whether the component is collapsed. When collapsed, only the collapse button and heading are displayed.

See also
Attribute
collapsed
Default value
false
Example
tableListElement.collapsed = true;

dragEnabled

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 4.29

Indicates whether list items may be reordered within the list by dragging and dropping. Drag won't be enabled until the number of list items is equal to or greater than than the value set set in minDragEnabledItems.

See also
Attribute
drag-enabled
Default value
false
Example
tableListElement.dragEnabled = true;

filterPlaceholder

Property
Type
string
Since
ArcGIS Maps SDK for JavaScript 4.29

Placeholder text used in the filter input if showFilter is true.

See also
Attribute
filter-placeholder
Default value
""
Example
tableListElement.filterPlaceholder = "Filter layers";

filterPredicate

Property
Type
FilterPredicate | null | undefined
Since
ArcGIS Maps SDK for JavaScript 4.32

Specifies a function to handle filtering list items.

Example
tableListElement.filterPredicate = (item) => item.title.toLowerCase().includes("streets");

filterText

Property
Type
string
Since
ArcGIS Maps SDK for JavaScript 4.29

The value of the filter input text string if showFilter is true.

See also
Attribute
filter-text
Default value
""
Example
reactiveUtils.watch(
() => tableListElement.filterText,
(filterText) => console.log(filterText)
);

hideStatusIndicators

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 5.0

Indicates whether the status indicators will be displayed.

Attribute
hide-status-indicators
Default value
false

icon

autocast Property
Type
Icon["icon"]

Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component).

See also
Attribute
icon
Default value
"table"

label

Property
Type
string

The component's default label.

Attribute
label

listItemCreatedFunction

Property
Type
ListItemModifier | null | undefined

Specifies a function that accesses each ListItem. Each list item can be modified according to its modifiable properties. Actions can be added to list items using the ListItem#actionsSections property of the ListItem.

Example
tableListElement.listItemCreatedFunction = (event) => {
const { item } = event;
item.actionsSections = [
[
{
title: "Open in feature table",
icon: "table",
id: "open-table"
}
]
];
}

map

Property
Type
WebMap | WebScene | null | undefined
Since
ArcGIS Maps SDK for JavaScript 4.34

A reference to a Map containing the tables. Set this property to access the underlying tables within the map.

See also

minDragEnabledItems

Property
Type
number
Since
ArcGIS Maps SDK for JavaScript 4.29

The minimum number of list items required to enable drag and drop reordering with dragEnabled.

See also
Attribute
min-drag-enabled-items
Default value
2
Example
tableListElement.dragEnabled = true;
tableListElement.minDragEnabledItems = 5;

minFilterItems

Property
Type
number
Since
ArcGIS Maps SDK for JavaScript 4.29

The minimum number of list items required to display the showFilter input box.

See also
Attribute
min-filter-items
Default value
10
Example
tableListElement.showFilter = true;
tableListElement.minFilterItems = 5;

referenceElement

Property
Type
ArcgisReferenceElement | string | undefined

By assigning the id attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.

See also
Attribute
reference-element

selectedItems

Property
Type
Collection<ListItem>

A collection of selected ListItems representing table list items selected by the user.

See also

selectionMode

Property
Type
"multiple" | "single" | "none" | "single-persist"
Since
ArcGIS Maps SDK for JavaScript 4.29

Specifies the selection mode. Selected items are available in the selectedItems property.

ValueDescription
multipleAllows any number of items to be selected at once. This is useful when you want to apply an operation to multiple items at the same time.
noneDisables selection. Use this when you want to prevent selecting items.
singleAllows only one item to be selected at a time. If another item is selected, the previous selection is cleared. This is useful when you want to ensure that a maximum of one item is selected at a time.
single-persistAllows only one item to be selected at a time and prevents de-selection. Once an item is selected, it remains selected until another item is selected. This is useful when you want to ensure that there is always exactly one selected item.
See also
Attribute
selection-mode
Default value
"none"
Example
tableListElement.selectionMode = "multiple";

showCloseButton

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 5.0

Indicates whether to display a close button in the header.

Attribute
show-close-button
Default value
false

showCollapseButton

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 5.0

Indicates whether to display a collapse button in the header.

Attribute
show-collapse-button
Default value
false

showErrors

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 5.0

Indicates whether to display layers with load errors.

Attribute
show-errors
Default value
false

showFilter

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 5.0

Indicates whether to display a filter input box when then number of list items is equal to or greater than the value set in TableList#minFilterItems, allowing users to filter tables by their title.

Attribute
show-filter
Default value
false

showHeading

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 5.0

Indicates whether to display the table list heading. The heading text is "Table List". The heading level can be set with the TableList#headingLevel.

Attribute
show-heading
Default value
false

showTemporaryTableIndicators

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 5.0

Indicates whether temporary table indicators will be displayed for tables with Layer#persistenceEnabled set to false. A temporary icon will be displayed on the near side of the table title.

Attribute
show-temporary-table-indicators
Default value
false

state

readonly Property
Type
State

The current state of the component.

Default value
"disabled"

tableItems

readonly Property
Type
Collection<TableListListItem>

The collection of table ListItems displayed within the component.

view

Property
Type
LinkChartView | MapView | SceneView | undefined

The view associated with the component.

Note: The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this view property which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-table-list component will be associated with a map or scene component rather than using the view property.

Methods

MethodSignature
componentOnReady
inherited
componentOnReady(): Promise<this>
destroy(): Promise<void>

componentOnReady

inherited Method
Signature
componentOnReady (): Promise<this>
Inherited from: PublicLitElement

Creates a promise that resolves once the component is fully loaded.

Returns
Promise<this>
Example
const arcgisTableList = document.querySelector("arcgis-table-list");
document.body.append(arcgisTableList);
await arcgisTableList.componentOnReady();
console.log("arcgis-table-list is ready to go!");

destroy

Method
Signature
destroy (): Promise<void>

Permanently destroy the component.

Returns
Promise<void>

Events

arcgisClose

Event
arcgisClose: CustomEvent<void>
Since
ArcGIS Maps SDK for JavaScript 4.33

Emitted when the component's close button is clicked.

bubbles composed cancelable

arcgisPropertyChange

Event
arcgisPropertyChange: CustomEvent<{ name: "state"; }>

Emitted when the value of a property is changed. Use this to listen to changes to properties.

bubbles composed cancelable

arcgisReady

Event
arcgisReady: CustomEvent<void>

Emitted when the component associated with a map or scene view is ready to be interacted with.

bubbles composed cancelable

arcgisTriggerAction

Event

Emitted when an action is triggered on the component.

bubbles composed cancelable