Skip to content
import AttachmentsColumnTemplate from "@arcgis/core/widgets/FeatureTable/support/AttachmentsColumnTemplate.js";
Inheritance:
AttachmentsColumnTemplateColumnTemplateBaseAccessor
Since
ArcGIS Maps SDK for JavaScript 4.31

A AttachmentsColumnTemplate formats and defines the structure of a AttachmentsColumn within a FeatureTable widget.

The AttachmentsColumnTemplate is set directly on the table's template or its view model. This template enables the display of multiple (@link module

/widgets/FeatureTable/AttachmentColumn attachment columns} anywhere within the table, offering enhanced configuration flexibility.

See also
Example
const attachmentsColumnTemplate = new AttachmentsColumnTemplate({
label: "Attachments",
});

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

autoWidth

inherited Property
Type
boolean
Inherited from: ColumnTemplateBase

Indicates if the column width will automatically adjust to account for large content. The column ignores the current width property when autoWidth is true.

Default value
false

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

description

inherited Property
Type
string | null | undefined
Inherited from: ColumnTemplateBase

A string description of the column to give context to what it represents.

See also

direction

inherited Property
Type
Direction
Inherited from: ColumnTemplateBase

Controls the sort order of the column. This property will only be honored on one column in the FeatureTable widget. If direction is specified on more than one column in the same FeatureTable, it will only be honored on the column with the highest index.

This is used in combination with the initialSortPriority and FeatureTable.multiSortEnabled properties to set sorting functionality for multiple columns.

Possible ValueDescription
ascSorts the column in ascending order.
descSorts the column in descending order.
nullNo sort is applied to the column.
See also

fieldName

inherited Property
Type
string
Inherited from: ColumnTemplateBase

The unique field name as defined by the data source.

flexGrow

inherited Property
Type
number
Inherited from: ColumnTemplateBase

Controls the flex-grow property for the column. When set to 0, cell width is fixed.

Default value
1

formatFunction

inherited Property
Type
FormatFunction | null | undefined
Inherited from: ColumnTemplateBase

Custom function for rendering cell content that is called when the column is rendered in the table. The function should return the formatted content to display within a table's cell. This can be a string, number, an HTML element, or equivalent node type (e.g. a Calcite component). If the content is an HTML element, it is appended to the root element. If the content is a string or number, it is set as the innerHTML of the root element. This property is useful when you want to customize the cell content. For example, you can use this property to create a custom cell renderer that displays a progress bar in the cell. The progress bar can be used to show the progress of a task.

Example
// The following example demonstrates how to use the formatFunction property to create a custom cell renderer that displays a progress bar in the cell. The progress bar can be used to show the progress of a task.
columnTemplate.formatFunction = ({ column, feature, index, value })=> {
const progress = document.createElement("progress");
progress.max = 100;
progress.value = value;
return progress;
};

frozen

readonlyinherited Property
Type
boolean
Inherited from: ColumnTemplateBase

Indicates if the the column is frozen in place at the beginning of the table. Column must be first in the FeatureTable's column's, or next to other frozen columns.

Default value
false

frozenToEnd

readonlyinherited Property
Type
boolean
Inherited from: ColumnTemplateBase

Indicates if the column is frozen in place at the end of the table. Column must be last in the FeatureTable's column's, or next to other columns with frozenToEnd set to true.

Default value
false

icon

inherited Property
Type
Icon["icon"] | null | undefined
Inherited from: ColumnTemplateBase

The string value indicating the icon displayed in the header cell of the column.

See also

iconText

inherited Property
Type
string | null | undefined
Inherited from: ColumnTemplateBase
Since
ArcGIS Maps SDK for JavaScript 4.32

The string value displayed when hovering over the associated icon displayed in the header cell of the column. When a value is not provied, the column label is displayed instead. A value for 'icon' must also be set on the template.

See also

initialSortPriority

inherited Property
Type
number | null | undefined
Inherited from: ColumnTemplateBase

Use this in combination with FeatureTable.multiSortEnabled and direction properties to set sorting functionality on multiple columns. This property indicates the index of the sorted column when compared to other columns, with lower numbers taking a higher priority.

If no sort priority is set, the priority defaults to the most recently-sorted column. This occurs when sorting via the UI, or programmatically by calling FeatureTable.sortColumn(). For example, using the example snippet below, the sort order priority is set for three columns, with "Status" having the least priority. Calling table.sortColumn("Status", "asc") would update the Status column to the highest priority. This would also occur if manually sorting via the column's UI.

See also
Example
const table = new FeatureTable({
layer: featureLayer,
multiSortEnabled: true,
tableTemplate: { // autocastable to TableTemplate
columnTemplates: [{ // autocastable to FieldColumnTemplate
type: "field",
fieldName: "ObjectId",
direction: "asc",
initialSortPriority: 1, // This field's sort order takes second-highest priority.
},
{
type: "field",
fieldName: "Name",
direction: "asc",
initialSortPriority: 0, // This field's sort order takes the highest priority.
},
{
type: "field",
fieldName: "Status",
direction: "asc",
initialSortPriority: 2 // This field's sort order is prioritized after Name and ObjectId, respectively.
}]
}
container: "tableDiv"
});

invalid

inherited Property
Type
boolean
Inherited from: ColumnTemplateBase

Indicates whether the column is in an invalid state.

Default value
false

label

inherited Property
Type
string | null | undefined
Inherited from: ColumnTemplateBase

The default label displayed in the column header cell.

labelTooltipText

inherited Property
Type
string | null | undefined
Inherited from: ColumnTemplateBase

Text displayed when hovering over the column header label. Defaults to the typical column label when a value is not provided.

inherited Property
Type
ColumnTableMenuConfig | null | undefined
Inherited from: ColumnTemplateBase

Configuration options for the column menu.

resizable

inherited Property
Type
boolean
Inherited from: ColumnTemplateBase

Indicates whether the column is resizable.

Default value
true

sortable

inherited Property
Type
boolean
Inherited from: ColumnTemplateBase

Indicates whether the column can be sorted. Columns based on custom content will not be sortable.

Default value
false

textAlign

inherited Property
Type
TextAlign
Inherited from: ColumnTemplateBase

Aligns the columns cell content horizontally.

Default value
"start"

textWrap

inherited Property
Type
boolean
Inherited from: ColumnTemplateBase

Indicates cell content should be wrapped and displayed on multiple lines within the cell.

This causes rows to expand when tall content is visible in the viewport. Scrolling tall cells into the viewport may cause the table to visually jump depending on the height of the expanding rows.

Default value
false

timeZone

inherited Property
Type
TimeZone | null | undefined
Inherited from: ColumnTemplateBase

The time zone of the specific column.

See also

type

readonly Property
Type
"attachment"

The type of column that the template represents.

visible

inherited Property
Type
boolean
Inherited from: ColumnTemplateBase

Indicates whether the column is visible.

Default value
true

width

inherited Property
Type
number | string
Inherited from: ColumnTemplateBase

Default width of the column in pixels.

Default value
200

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
clone
inherited
clone(): this
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameters
ParameterTypeDescriptionRequired
json
any

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns
any

Returns a new instance of this class.

clone

inherited Method
Signature
clone (): this
Inherited from: ClonableMixin

Creates a deep clone of this object. Any properties that store values by reference will be assigned copies of the referenced values on the cloned instance.

Returns
this

A deep clone of the class instance that invoked this method.

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.