Element: <oj-optgroup>

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

Signature:

class ojOptgroup

QuickNav

Attributes

JET Custom Elements

JET components are implemented as custom HTML elements. In addition to the component attributes documented in this page, JET components also support standard HTML global attributes like id and aria-label.

The JET data binding syntax can be used to define both component and global attributes through the use of dynamically evaluated expressions. All attributes (component and global) support attribute-level binding by prefixing the attribute name with ":" (e.g. :id="[...]"). When using attribute-level binding, all expression values are treated as strings. Additionally, component attributes support property-level binding by using the attribute name directly with no ":" prefix. When using property-level binding, the expressions should evaluate to the types documented by the corresponding attributes. Property-level binding is strongly recommended over attribute-level binding for component attributes.

A detailed description of working with custom HTML elements can be found in: JET Custom Element Usage.



PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Version:
  • 7.1.0
Since:
  • 4.0.0
Module:
  • ojoptgroup

Module usage

See JET Module Loading for an overview of module usage within JET.

Typescript Import Format
//To typecheck the element APIs, import as below.
import {ojOptgroup} from "ojs/ojoptgroup";

//For the transpiled javascript to load the element's module, import as below
import "ojs/ojoptgroup";

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.


JET Optgroup

The oj-optgroup element is used to group oj-option elements.

For example:


<oj-select-one>
  <oj-optgroup label="group1 label">
    <oj-option value="option 1">option 1</oj-option>
    <oj-option value="option 2">option 2</oj-option>
  </oj-optgroup>
  <oj-optgroup label="group2 label">
    <oj-option value="option 3">option 3</oj-option>
    <oj-option value="option 4">option 4</oj-option>
  </oj-optgroup>
</oj-select-one>

Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.

Slots

JET components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.

Default

The oj-optgroup element accepts oj-option elements as children. See the oj-option documentation for details about accepted children and slots.

Attributes

disabled :boolean

Disables the oj-optgroup if set to true.

Default Value:
  • false
Names
Item Name
Property disabled
Property change event disabledChanged
Property change listener attribute (must be of type function) on-disabled-changed

label :string

Specifies the oj-optgroup's label.

Names
Item Name
Property label
Property change event labelChanged
Property change listener attribute (must be of type function) on-label-changed

Methods

getProperty(property) → {any}

Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description
property string The property name to get. Supports dot notation for subproperty access.
Returns:
Type
any

refresh() → {void}

Refreshes the visual state of the component.
Returns:
Type
void

setProperties(properties) → {void}

Performs a batch set of properties.
Parameters:
Name Type Description
properties Object An object containing the property and value pairs to set.
Returns:
Type
void

setProperty(property, value) → {void}

Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description
property string The property name to set. Supports dot notation for subproperty access.
value any The new value to set the property to.
Returns:
Type
void