Skip to content
import RelationshipColumn from "@arcgis/core/widgets/FeatureTable/RelationshipColumn.js";
Inheritance:
RelationshipColumnColumnAccessor
Since
ArcGIS Maps SDK for JavaScript 4.30

The RelationshipColumn class works with the FeatureTable to display any associated related records for each feature in the table. This column will only be displayed if the related layer or table is also added to the map. If a feature has related records and the table is configured to enable related records, the count of related records is displayed in the cell. Whereas the cell is empty if the feature does not have related records. This column is always appended to the end of the table.

This class should be used for observing potential changes. It is designed primarily to read and not interact directly with the relationship columns.

relationship columns

See also

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.
PropertyTypeClass
autoWidth
inherited
declaredClass
readonly inherited
description
inherited
direction
inherited
effectiveDescription
readonly inherited
effectiveLabel
readonly
fieldName
readonly inherited
flexGrow
inherited
formatFunction
readonly inherited
frozen
readonly inherited
frozenToEnd
readonly inherited
hidden
inherited
Icon["icon"]
iconText
inherited
initialSortPriority
readonly inherited
invalid
inherited
label
inherited
labelTooltipText
inherited
layer
readonly
menu
readonly inherited
menuConfig
readonly inherited
menuIsOpen
readonly inherited
menuIsVisible
readonly inherited
relatedLayer
readonly
relationship
readonly
relationshipId
readonly
resizable
readonly
sortable
inherited
tableTimeZone
readonly inherited
textAlign
readonly
textWrap
inherited
timeZone
inherited
visibleElements
inherited

autoWidth

inherited Property
Type
boolean
Inherited from: Column

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

collapsed

Property
Type
boolean

Indicates whether the column displays collapsed. If collapsed, the header will always display as empty.

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: Column

Contains information describing the purpose of each column.

direction

inherited Property
Type
Direction
Inherited from: Column

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

effectiveDescription

readonlyinherited Property
Type
string | null | undefined
Inherited from: Column
Since
ArcGIS Maps SDK for JavaScript 4.31

The sanitized description string, describing the purpose of each column.

effectiveLabel

readonly Property
Type
string

The sanitized label displayed within the FeatureTable header for the relationship column. If the label is not provided, the name of the relationship is used. If the relationship name is not provided, the title of the related layer is used.

See also

fieldName

readonlyinherited Property
Type
string
Inherited from: Column

The unique field name as defined by the data source.

flexGrow

inherited Property
Type
number
Inherited from: Column

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

Default value
1

formatFunction

readonlyinherited Property
Type
FormatFunction | null | undefined
Inherited from: Column

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. If the content is null, the root element is cleared. If the content is undefined, the root element is not modified. 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.
column.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: Column

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: Column

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

hidden

inherited Property
Type
boolean
Inherited from: Column

Indicates whether the column is visible.

Default value
false

icon

Property
Type
Icon["icon"]

The Calcite Icon displayed within the FeatureTable header for the attachments column.

See also
Default value
"link"

iconText

inherited Property
Type
string | null | undefined
Inherited from: Column
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 column.

See also

initialSortPriority

readonlyinherited Property
Type
number | null | undefined
Inherited from: Column

Indicates the initial sort priority of the column when first rendered.

invalid

autocast inherited Property
Type
boolean
Inherited from: Column

Indicates whether the column is in an invalid state.

label

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

The default label displayed in the column header cell.

labelTooltipText

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

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

layer

readonly Property
Type
FeatureLayer | SceneLayer

The layer that contains the features being displayed in the table.

readonlyinherited Property
Type
HTMLElement
Inherited from: Column

The element representing the field column's menu.

readonlyinherited Property
Type
ColumnTableMenuConfig | null | undefined
Inherited from: Column

Configuration options for the column's menu.

FeatureTable.tableTemplate.

readonlyinherited Property
Type
boolean
Inherited from: Column

Indicates whether the column's menu is currently open.

readonlyinherited Property
Type
boolean
Inherited from: Column

Indicates whether the Column's menu will be displayed.

originRelationship

readonly Property
Type
Relationship | null | undefined

Returns the Relationship of the relatedLayer to find a relationship that has the same id as the relationshipId.

relatedLayer

readonly Property
Type
FeatureLayer | SceneLayer

The layer that contains the related features being displayed in the table.

relationship

readonly Property
Type
Relationship | null | undefined

Returns the first relationship from layer's relationships that matches the relationshipId.

relationshipId

readonly Property
Type
number

The unique ID for the relationship.

See also

resizable

readonly Property
Type
boolean

Indicates whether the relationship column can be resized. This is always set to true.

Default value
true

sortable

inherited Property
Type
boolean
Inherited from: Column

Indicates whether the column is sortable.

Default value
false

tableTimeZone

readonlyinherited Property
Type
TimeZone | null | undefined
Inherited from: Column
Since
ArcGIS Maps SDK for JavaScript 4.31

The FeatureTable.timeZone of the parent table widget.

textAlign

readonly Property
Type
TextAlign

The text alignment of the relationship column.

Default value
"center"

textWrap

inherited Property
Type
boolean
Inherited from: Column

Indicates cell content should be wrapped and displayed on multiple lines within the cell. Warning: 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

visibleElements

inherited Property
Type
VisibleElements | null | undefined
Inherited from: Column

The visible elements of the column's associated FeatureTable.

width

Property
Type
number | string

Default width of the relationship column in pixels.

Default value
"200px"

Methods

MethodSignatureClass
closeMenu
inherited
closeMenu(): void
openMenu
inherited
openMenu(): void
sort
inherited
sort(): void

closeMenu

inherited Method
Signature
closeMenu (): void
Inherited from: Column

Convenience method for closing the column menu.

See also
Returns
void

openMenu

inherited Method
Signature
openMenu (): void
Inherited from: Column

Convenience method for opening the column menu. This has no effect if the menu is not visible or has no menu items. It follows the direction pattern of ascending, to descending, then no sort order.

See also
Returns
void

sort

inherited Method
Signature
sort (): void
Inherited from: Column

Convenience method for sorting the current column. It has no effect if the column is not sortable.

See also
Returns
void