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 elements can have up to two types of child content:
- Any child element with a
slotattribute will be moved into that named slot, e.g.<span slot='startIcon'>...</span>. - Any child element lacking a
slotattribute will be moved to the default slot, also known as a regular child. This is documented under the "Default" heading below.
-
Default
-
The oj-optgroup element accepts
oj-options as children. See the oj-option doc for details about accepted children and slots.Example
Initialize the oj-optgroup with child content specified:
<oj-optgroup> <oj-option value="option1">Option label</oj-option> </oj-optgroup>
Attributes
-
disabled :boolean
-
Disables the oj-optgroup if set to
true.- Default Value:
false
Names
Item Name Property disabledProperty change event disabledChangedProperty change listener attribute (must be of type function) on-disabled-changedExamples
Initialize the oj-optgroup with the
disabledattribute specified:<oj-optgroup disabled="[[isDisabled]]"></oj-optgroup>Get or set the
disabledproperty after initialization:// getter var disabledValue = myOptgroup.disabled; // setter myOptgroup.disabled = true; -
label :string
-
Specifies the oj-optgroup's label.
Names
Item Name Property labelProperty change event labelChangedProperty change listener attribute (must be of type function) on-label-changedExamples
Initialize the oj-optgroup with the
labelattribute specified:<oj-optgroup label="group1 label"></oj-optgroup>Get or set the
labelproperty after initialization:// getter var labelValue = myOptgroup.label; // setter myOptgroup.label = 'Group 1';
Methods
-
getProperty(property) → {any}
-
Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
Example
Get a single subproperty of a complex property:
var subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2'); -
refresh()
-
Refreshes the visual state of the component.
-
setProperties(properties)
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. Example
Set a batch of properties:
myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"}); -
setProperty(property, value)
-
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 propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. Example
Set a single subproperty of a complex property:
myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");