# Class FieldExtension

Extends the capabilities of an Esri Field object.

#### Hierarchy (view full)

- EntityBase<FieldExtensionProperties>
  - FieldExtension

#####
Index

### Constructors

constructor

### Properties

_id
_itemType
format
formatSettings
searchable

### Accessors

failureMode
field
fieldInfo
id
isDestroyed
isInitialized
itemType
schema

### Methods

_getSerializableProperties
_initializableChildCollections
_initializeChildren
_onDestroy
_onInitialize
_postInitialize
_toPropertyDef
assignProperties
assignPropertiesAsync
destroy
emit
finishAssignProperties
getDefault
getDefaults
getSerializableProperties
initialize
on
toItemUri
toJSON
matchesRef

##
Constructors

### constructor

- new FieldExtension(properties?): FieldExtension

- Creates a new instance of data/FieldExtension!FieldExtension.

  #### Parameters

  - `Optional` properties: FieldExtensionProperties

    An object containing initial property values to set.

  #### Returns FieldExtension

  Overrides EntityBase.constructor

##
Properties

### `Protected`_id

_id: string

The unique ID for this entity. Once set, this should never change.

Inherited from EntityBase._id

### `Protected` `Readonly`_itemType

_itemType: string = ItemType.FIELD_EXTENSION

The item type for this entity when it participates in an App.

Overrides EntityBase._itemType

### format

format: string = "{0}"

The field format specifier. This is a standard .NET-style format string containing as `{0}` placeholder that will be replaced by the actual field value.

### `Readonly` formatSettings

formatSettings: FormatSettings = ...

Settings that affect how values are formatted. Depending on the type of field, some or all of these settings may not be applicable.

### searchable

searchable: boolean = true

Whether the field is searchable or not.

##
Accessors

### failureMode

- get failureMode(): FailureMode

- Determines how a parent object should handle initialization failure in this object. The default is "warn".

  - `"error"`: support/InitializeError!InitializeError is thrown.
  - `"warn"`: Message is logged and support/InitializableBase!InitializeWarningEvent is raised.
  - `"ignore"`: support/InitializableBase!InitializeWarningEvent is raised.

  #### Returns FailureMode

  Inherited from EntityBase.failureMode

- set failureMode(value): void

- #### Parameters

  - value: FailureMode

  #### Returns void

  Inherited from EntityBase.failureMode

### field

- get field(): Field

- The Esri Field object being extended.

  #### Returns Field

### fieldInfo

- get fieldInfo(): FieldInfo

- The corresponding esri field info object.

  #### Returns FieldInfo

### id

- get id(): string

- The unique ID for this entity.

  #### Returns string

  Inherited from EntityBase.id

### isDestroyed

- get isDestroyed(): boolean

- See support/InitializableBase!Initializable.isDestroyed.

  #### Returns boolean

  Inherited from EntityBase.isDestroyed

### isInitialized

- get isInitialized(): boolean

- See support/InitializableBase!Initializable.isInitialized.

  #### Returns boolean

  Inherited from EntityBase.isInitialized

### itemType

- get itemType(): string

- The item type for this entity when it participates in an App.

  #### Returns string

  Inherited from EntityBase.itemType

### schema

- get schema(): Schema

- The parent schema.

  #### Returns Schema

##
Methods

### `Protected`_getSerializableProperties

- _getSerializableProperties(): PropertyDefs<FieldExtensionProperties>

- The property keys and their metadata that are used to implement serializing and deserializing the class instance.

  #### Returns PropertyDefs<FieldExtensionProperties>

  Overrides EntityBase._getSerializableProperties

### `Protected`_initializableChildCollections

- _initializableChildCollections(): IterableIterator<Collection<InitializableBase<InitializableBaseProperties>>, any, any>

- Collections of child items to initialize. Items that fail to initialize are removed from the collection.

  #### Returns IterableIterator<Collection<InitializableBase<InitializableBaseProperties>>, any, any>

  Inherited from EntityBase._initializableChildCollections

### `Protected`_initializeChildren

- _initializeChildren(): Promise<void>

- Initializes child entities.

  #### Returns Promise<void>

  Inherited from EntityBase._initializeChildren

### `Protected`_onDestroy

- _onDestroy(): Promise<void>

- Called to perform cleanup. Subclasses should override this method rather than destroy() to perform custom cleanup.

  #### Returns Promise<void>

  Inherited from EntityBase._onDestroy

### `Protected`_onInitialize

- _onInitialize(): Promise<void>

- Called to perform initialization of the support/InitializableBase!InitializableBase. Subclasses should override this method rather than initialize() to perform custom initialization.

  #### Returns Promise<void>

  Overrides EntityBase._onInitialize

### `Protected`_postInitialize

- _postInitialize(): Promise<void>

- Called after normal initialization. Note: Child items are initialized before this is called.

  #### Returns Promise<void>

  Inherited from EntityBase._postInitialize

### `Protected`_toPropertyDef

- _toPropertyDef<T>(def): PropertyDef<T>

- Converts the value to a PropertyDef object.

  #### Type Parameters

  - T

  #### Parameters

  - def: PropertyDefSerializeMode | PropertyDefSerializeMode[] | PropertyDef<T>

    The value to convert.

  #### Returns PropertyDef<T>

  Inherited from EntityBase._toPropertyDef

### assignProperties

- assignProperties(properties): void

- #### Parameters

  - properties: Partial<FieldExtensionProperties>

  #### Returns void

  #### Inherit Doc

  Inherited from EntityBase.assignProperties

### assignPropertiesAsync

- assignPropertiesAsync(properties): Promise<void>

- #### Parameters

  - properties: Partial<FieldExtensionProperties>

  #### Returns Promise<void>

  #### Inherit Doc

  Inherited from EntityBase.assignPropertiesAsync

### destroy

- destroy(): Promise<void>

- A clean-up function that should get called whenever the item is disposed of.

  #### Returns Promise<void>

  Inherited from EntityBase.destroy

### emit

- emit(name, event): boolean

- Emits an event on the instance.

  #### Parameters

  - name: string
  - event: unknown

    The event payload.

    Read more...

  #### Returns boolean

  Inherited from EntityBase.emit

### finishAssignProperties

- finishAssignProperties(): Promise<void>

- #### Returns Promise<void>

  #### Inherit Doc

  Inherited from EntityBase.finishAssignProperties

### getDefault

- getDefault<K>(key): FieldExtensionProperties[K]

- #### Type Parameters

  - K extends keyof FieldExtensionProperties

  #### Parameters

  - key: K

  #### Returns FieldExtensionProperties[K]

  #### Inherit Doc

  Inherited from EntityBase.getDefault

### getDefaults

- getDefaults(): FieldExtensionProperties

- #### Returns FieldExtensionProperties

  #### Inherit Doc

  Inherited from EntityBase.getDefaults

### getSerializableProperties

- getSerializableProperties(serializeMode?): PropertyDefs<FieldExtensionProperties>

- Returns the serializable properties.

  #### Parameters

  - `Optional` serializeMode: SerializeMode

    Optional. If specified, only properties that support the given serialization mode will be returned.

  #### Returns PropertyDefs<FieldExtensionProperties>

  Inherited from EntityBase.getSerializableProperties

### initialize

- initialize(): Promise<void>

- Initializes the item.

  #### Returns Promise<void>

  Inherited from EntityBase.initialize

### on

- on(name, callback): IHandle

- Registers an event handler on the instance.

  #### Parameters

  - name: string | string[]
  - callback: EventCallback<any>

  #### Returns IHandle

  Inherited from EntityBase.on

### toItemUri

- toItemUri(): string

- Creates an item:// URI reference to this entity.

  #### Returns string

  Inherited from EntityBase.toItemUri

### toJSON

- toJSON(serializeMode?): FieldExtensionProperties

- #### Parameters

  - serializeMode: SerializeMode = "all"

  #### Returns FieldExtensionProperties

  #### Inherit Doc

  Inherited from EntityBase.toJSON

### `Static` matchesRef

- matchesRef(fieldX, fieldRef): boolean

- Checks to see if a field matches a field reference.

  #### Parameters

  - fieldX: Field | FieldExtension

    The field or FieldExtension to match with a reference.

  - fieldRef: FieldProperties

    The field reference to match with a field.

  #### Returns boolean