Methods
-
<static> createDynamicPropertyGetter(callback) → {Object}
-
Creates a dynamic getter that can be used as a property value in oj.Components.setDefaultOptions()
Parameters:
Name Type Description callback
Function dynamic property callback. The callback will receive a context object as a parameter. The following properties are currently supported on the context object: - containers - an array of component names of the current component's containers that require special behavior from their children
- Source:
- See:
Returns:
- dynamic property getter- Type
- Object
-
<static> getDefaultOptions() → {Object}
-
Retrieves default option values for JET components.
- Source:
- See:
Returns:
default option values- Type
- Object
-
<static> getWidgetConstructor(element, widgetName) → {Function|null}
-
Retrieves widget constructor associated with the HTML element or null if none is found. The returned constructor is already bound to the associated JQuery element, so it can be invoked as a function directly. For example:
widgetConstructor("option", "label", "custom"); // sets label option
If widgetName is not specified, and if more than one widget is associated with the element, the method will a return the widget that was created first.Parameters:
Name Type Argument Description element
Element HTML element widgetName
string <optional>
optional widget name - Source:
Returns:
widget constructor- Type
- Function | null
-
<static> isComponentInitialized(jelement, widgetName) → {boolean}
-
Determines if a component identified by the
widgetName
has been bound and initialized on a givenjelement
.Parameters:
Name Type Description jelement
jQuery to which the component is bound widgetName
string constructor name of the target component. - Source:
Returns:
true
if the component identified by the widgetName has be bound and initialized to the target element.- Type
- boolean
-
<static> setDefaultOptions(options)
-
Sets default options values for JET components.
Parameters:
Name Type Description options
Object property values that will be merged into the values that were previously set using this method. The options object is expected to have the format demonstrated by the following example: { 'default': // properties for all JET components { 'option1': 'somevalue' }, 'editableValue': // properties for editableValue components { 'option1': 'somevalue1', 'option2': oj.Components.createDynamicPropertyGetter(function(context){ return context['containers'].indexOf('ojTable') >= 0 ? 'tableValue' : 'normalValue'}) }, 'ojText': // properties for instances of ojText { 'option1': 'somevalue2' } }
To specify a dynamic getter for the property, pass your callback to oj.Components.createDynamicPropertyGetter(). Note that dynamic getters nested within a complex property value are not supported -
<static> subtreeAttached(node)
-
Notifies JET framework that a subtree possibly containing JET components has been inserted into the document programmatically. Note that there is no need to call this method when the new DOM is being inserted by the template engine in Knockout.js
Parameters:
Name Type Description node
Element the root of the subtree - Source:
- See:
-
<static> subtreeDetached(node)
-
Notifies JET framework that a subtree possibly containing JET components has been removed from the document programmatically. Note that calling this method is not needs after calling JQuery's .remove() because all JET components would have been already destroyed in that case. Similarly, there is no need to call this method after the subtree has been removed by Knockout.js
Parameters:
Name Type Description node
Element the root of the subtree - Source:
- See:
-
<static> subtreeHidden(node)
-
Notifies JET framework that a subtree possibly containing JET components has been hidden with display:none style This method should be called by the application after the subtree has been hidden programmatically, such as when JQuery's .hide() method is called.
Parameters:
Name Type Description node
Element the root of the subtree - Source:
- See:
-
<static> subtreeShown(node)
-
Notifies JET framework that a subtree possibly containing JET components is no longer hidden with display:none style This method should be called by the application if the 'display' style is being changed from 'hidden' programmatically, such as when JQuery's .show() method is called
Parameters:
Name Type Description node
Element the root of the subtree - Source:
- See: