▾
import "@arcgis/map-components/components/arcgis-table-list";- Inheritance
- ArcgisTableList→
HTMLElement
- 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 itemportalItem: {id: "add portal item id"}});// Wait for the layer to loadawait layer.load()// Check if the layer is a tableif (layer.isTable) {// Add the table to the map's tables collectionviewElement.map.tables.add(layer);}
Properties
| Property | Attribute | Type |
|---|---|---|
| auto-destroy-disabled | ||
| closed | ||
| reflected | collapsed | |
| drag-enabled | ||
| filter-placeholder | ||
| | ||
| filter-text | ||
| heading-level | ||
| hide-status-indicators | ||
| icon | Icon["icon"] | |
| label | ||
| | ||
| | ||
| min-drag-enabled-items | ||
| min-filter-items | ||
| reference-element | ||
| | ||
| selection-mode | "none" | "multiple" | "single" | "single-persist" | |
| show-close-button | ||
| show-collapse-button | ||
| show-errors | ||
| show-filter | ||
| show-heading | ||
| show-temporary-table-indicators | ||
| readonly | | |
| readonly | | |
| |
autoDestroyDisabled
- 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
- Example
- <arcgis-table-list auto-destroy-disabled></arcgis-table-list>tableListElement.autoDestroyDisabled = true;
closed
- 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
- Example
- <arcgis-table-list closed></arcgis-table-list>tableListElement.closed = true;
collapsed
- 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
- 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 the value set in minDragEnabledItems.
- See also
- Attribute
- drag-enabled
- Default value
- false
- Example
- tableListElement.dragEnabled = true;
filterPlaceholder
- 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
- 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
- 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
- Type
- boolean
Indicates whether to hide status indicators in the component.
- Attribute
- hide-status-indicators
- Default value
- false
- Example
- <arcgis-table-list hide-status-indicators></arcgis-table-list>tableListElement.hideStatusIndicators = true;
icon
- 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"
listItemCreatedFunction
- 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
- 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
- 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
- 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
- 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.
- Attribute
- reference-element
selectedItems
- Type
- Collection<ListItem>
A collection of selected ListItems representing table list items selected by the user.
- See also
selectionMode
- Type
- "none" | "multiple" | "single" | "single-persist"
- Since
- ArcGIS Maps SDK for JavaScript 4.29
Specifies the selection mode. Selected items are available in the selectedItems property.
| Value | Description |
|---|---|
| multiple | Allows 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. |
| none | Disables selection. Use this when you want to prevent selecting items. |
| single | Allows 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-persist | Allows 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
-
In version 6.0, the implementation of arcgis-table-list will be updated under the hood to that of arcgis-table-list-next. We encourage using the arcgis-table-list-next component and providing feedback.
-
- Attribute
- selection-mode
- Default value
- "none"
- Example
- tableListElement.selectionMode = "multiple";
showCloseButton
- Type
- boolean
This property provides the ability to show or hide the close button. When the close button is shown, the ESC key can be used to close the component via keyboard when the focus is within the component.
- Attribute
- show-close-button
- Default value
- false
- Example
- <arcgis-table-list show-close-button></arcgis-table-list>tableListElement.showCloseButton = true;
showCollapseButton
- Type
- boolean
This property provides the ability to show or hide the collapse button.
- Attribute
- show-collapse-button
- Default value
- false
- Example
- <arcgis-table-list show-collapse-button></arcgis-table-list>tableListElement.showCollapseButton = true;
showErrors
- Type
- boolean
This property provides the ability to show or hide layer error indicators.
- Attribute
- show-errors
- Default value
- false
- Example
- <arcgis-table-list show-errors></arcgis-table-list>tableListElement.showErrors = true;
showFilter
- Type
- boolean
This property provides the ability to show or hide the filter input box when then number of list items is equal to or greater than the value set in minFilterItems, allowing users to filter layers by their title.
- Attribute
- show-filter
- Default value
- false
- Example
- <arcgis-table-list show-filter></arcgis-table-list>tableListElement.showFilter = true;
showHeading
- Type
- boolean
This property provides the ability to show or hide the heading.
- Attribute
- show-heading
- Default value
- false
- Example
- <arcgis-table-list show-heading></arcgis-table-list>tableListElement.showHeading = true;
showTemporaryTableIndicators
- Type
- boolean
This property provides the ability to show or hide the temporary table indicators 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
- Example
- <arcgis-table-list show-temporary-table-indicators></arcgis-table-list>tableListElement.showTemporaryTableIndicators = true;
tableItems
- Type
- Collection<TableListListItem>
The collection of table ListItems displayed within the component.
view
- 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
viewproperty 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 theviewproperty.
Methods
| Method | Signature |
|---|---|
| inherited | componentOnReady(): Promise<this> |
| destroy(): Promise<void> |
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
- Example
- const arcgisTableList = document.createElement("arcgis-table-list");document.body.append(arcgisTableList);await arcgisTableList.componentOnReady();console.log("arcgis-table-list is ready to go!");
Events
| Name | Type |
|---|---|
| CustomEvent<{ name: "state"; }> | |
arcgisClose
arcgisClose: CustomEvent<void> - Since
- ArcGIS Maps SDK for JavaScript 4.33
Emitted when the component's close button is clicked.
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "state"; }> Emitted when the value of a property is changed. Use this to listen to changes to properties.
arcgisReady
arcgisReady: CustomEvent<void> Emitted when the component associated with a map or scene view is ready for user interaction.
arcgisTriggerAction
arcgisTriggerAction: CustomEvent<TableListViewModelTriggerActionEvent> Emitted when an action is triggered on the component.