Class: Context

Oracle® JavaScript Extension Toolkit (JET)
3.2.0

E87541-01

QuickNav

oj. Context

Version:
  • 3.2.0
Since:
  • 2.1.0
This is a general purpose context. Initially it only exposes the BusyContext that keeps track of components that are currently animating or fetching data. In the future this context might be expanded for other purposes.

Constructor

new Context(node)

The constructor should never be invoked by an application directly. Use oj.Context.getPageContext and oj.Context.getContext APIs to retrieve an instance of the context.
Parameters:
Name Type Argument Description
node Element <optional>
DOM node where the context should be created
Source:

Methods

<static> getContext(node) → {oj.Context}

Returns the closest enclosing JET context for a node. Any DOM element may be designated by the page author as a host of JET context. The designation must be expressed in HTML markup by specifying the "data-oj-context" attribute on the host element:
<div data-oj-context><div>

This method will walk up the element hierarchy starting with the source node to find an element that has the data-oj-context attribute. If no such element is found, the page context will be returned.

If the JET context is established on a particular element, the oj.BusyContext associated with that context will be tracking busy states for that element and its subtree
Parameters:
Name Type Description
node Element DOM element whose enclosing context will be provided
Since:
  • 2.2.0
Source:
See:
  • oj.BusyContext for code examples
Returns:
context object scoped per the target node
Type
oj.Context

<static> getPageContext() → {oj.Context}

Static factory method that returns the page context.
Since:
  • 2.1.0
Source:
See:
  • oj.BusyContext for code examples
Returns:
context scoped for the page
Type
oj.Context

getBusyContext() → {oj.BusyContext}

Since:
  • 2.1.0
Source:
See:
  • oj.BusyContext for code examples
Returns:
busy state context
Type
oj.BusyContext

Non-public Methods

<protected> Init(node)

Parameters:
Name Type Argument Description
node Element <optional>
DOM node where the context should be created
Source: