require(["esri/tables/elements"], (elements) => { /* code goes here */ });
import * as elements from "@arcgis/core/tables/elements.js";
esri/tables/elements
A convenience module for importing AttributeTableElement classes when developing with TypeScript. For example, rather than importing table elements one at a time like this:
import TableAttachmentElement from "esri/tables/elements/AttributeTableAttachmentElement";
import TableFieldElement from "esri/tables/elements/AttributeTableFieldElement";
import TableGroupElement from "esri/tables/elements/AttributeTableGroupElement";
import TableRelationshipElement from "esri/tables/elements/AttributeTableRelationshipElement";
You can use this module to import them on a single line:
import { AttributeTableAttachmentElement, AttributeTableFieldElement, AttributeTableGroupElement, AttributeTableRelationshipElement } from "esri/tables/elements";
This module also allows you to implement type guards on the attribute table elements, making your code smarter.
import { AttributeTableElement } from "esri/tables/elements";
function logTableElement(element: AttributeTableElement): void {
if (element.type === "field") {
console.log("Attribute table element type is field");
}
else {
console.log("The value is not a table field element.")
}
}
Type Definitions
-
AttributeTableAttachmentElement
AttributeTableAttachmentElement AttributeTableAttachmentElement
-
AttributeTableAttachmentElement
defines how one or more attachments can participate in the attribute table.
-
AttributeTableElement
AttributeTableElement AttributeTableFieldElement |AttributeTableGroupElement |AttributeTableRelationshipElement |AttributeTableAttachmentElement
-
Attribute table element types.
-
AttributeTableFieldElement
AttributeTableFieldElement AttributeTableFieldElement
-
AttributeTableFieldElement
defines how a feature layer's field participates in the attribute table.
-
AttributeTableGroupElement
AttributeTableGroupElement AttributeTableGroupElement
-
AttributeTableGroupElement
defines a container that holds a set of attribute table elements that can be displayed together.
-
AttributeTableRelationshipElement
AttributeTableRelationshipElement AttributeTableRelationshipElement
-
AttributeTableRelationshipElement
defines how a relationship between feature layers and tables participates in the FeatureTable.