Skip to content

Class: Context

A Context object groups a binding (any value or object composed of data) and an optional UI element. It also holds on to some miscellaneous data that gets used in rules via a ClientAPI object. A context is the result of every target path segment evaluation. A ClientAPI object provides an interface to a Context that can be used when evaluating rules.

Implements

Summary

Constructors

Properties

Class Properties

Inherited Properties

Currently none inherited from the parent class(es).

Accessors

Class Accessors

Inherited Accessors

Currently none inherited from the parent class(es).

Methods

Class Methods

Inherited Methods

Currently none inherited from the parent class(es).

Constructors

Constructor

+ new Context(binding?: any, element?: any, isSectionedTableBackwardCompatible?: boolean): Context

Parameters:

Name Type
binding? any
element? any
isSectionedTableBackwardCompatible? boolean

Returns: Context

Properties

binding?

optional binding?: any

provide a simple property access to the binding

Implementation of IContext.binding

clientAPIProps

clientAPIProps: IClientAPIProps = {}

Associated IClientAPIProps object

Implementation of IContext.clientAPIProps

element?

optional element?: any

This context's associated UI element object such as page, control, sectionedTable etc

Implementation of IContext.element

isSectionedTableBackwardCompatible?

optional isSectionedTableBackwardCompatible?: boolean

A boolean to determine if the context is backward compatible with sectionedTable

Implementation of IContext.isSectionedTableBackwardCompatible

Accessors

clientAPI

Get Signature

getter

Get the clientAPI object

Returns

IClientAPI

Associated ClientAPI object

Implementation of IContext.clientAPI


clientData

Get Signature

getter

Get the client data object. This starts out as a plain JavaScript object, and can be modified to hold application state. Can only be accessed for IClientAPI instances associated with a UI element, because that guarantees that the data will last for the lifetime of that element.

Returns

IClientData

Get the Get the client data object. This starts out as a plain JavaScript object, and can be modified to hold application state. Can only be accessed for IClientAPI instances associated with a UI element, because that guarantees that the data will last for the lifetime of that element.

Implementation of IContext.clientData


Get Signature

getter

Get this context's binding's associated readLink if any. Otherwise undefined.

Returns

string

This context's binding's associated readLink if any. Otherwise undefined.

Implementation of IContext.readLink

Methods

resetClientAPIProps

resetClientAPIProps(): void

Delete all relevant properties from the embedded clientAPIProps object

Implementation of IContext.resetClientAPIProps

Returns: void


Static fromPage

fromPage(source?: ExecuteSource): IContext

Get the context of the current rendered page

Parameters:

Name Type
source? ExecuteSource

Returns: IContext