Usage
Signature:
interface CAccordionItemSingleElement<K extends string | number>
Generic Parameters
Parameter Description K Type extends string or number
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CAccordionItemSingleElement } from "oj-c/accordion-item-single";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/accordion-item-single";
For additional information visit:
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 content node to be expanded or collapsed. Place any content to be shown/hidden inside this property.
-
header
-
Item's header. If not specified, the header contains only an open/close icon. The header text is required for accessibility purposes.
Attributes
-
disabled :boolean
-
Disables the item if set to true.
Names
Item Name Property disabledProperty change event disabledChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-disabled-changed -
expanded-key :(K|null)
-
Specifies the expandedKey property. Use
expandedKeyto control which item is expanded. Bind this property to an observable in your ViewModel (e.g.,ko.Observable<string | null>) to programmatically expand/collapse items.- Supports writeback:
true
Names
Item Name Property expandedKeyProperty change event expandedKeyChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-expanded-key-changed -
icon-position :"end"|"start"
-
Changes chevron icon placement at the end of the collapsible header.
Names
Item Name Property iconPositionProperty change event iconPositionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-icon-position-changed -
item-key :K
-
Specifies the item key of each AccordionItemSingle. Use
itemKeyto uniquely identify each item in the accordion.Names
Item Name Property itemKeyProperty change event itemKeyChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-item-key-changed
Events
-
ojCollapse
-
Note: The event detail contains the following properties: oj-c.AccordionItemSingle.AccordionItemSingleDetail<K>
Triggered after the item has been collapsed (after animation completes).See Events and Listeners for additional information.
-
ojExpand
-
Note: The event detail contains the following properties: oj-c.AccordionItemSingle.AccordionItemSingleDetail<K>
Triggered after the item has been expanded (after animation completes).See Events and Listeners for additional information.
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesobject 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 corresponding 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. Returns:
- Type
- void
Type Definitions
Documentation-only Types
Note: Type definitions in this section have been provided for documentation purposes and cannot be imported into application code.
-
AccordionItemSingleDetail<K extends string | number>
-
Payload for the onOjCollapse event and onOjExpand event.
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description from K | undefined The key of the item that was previously expanded. to K | null The key of the item that is now expanded. Properties:
Name Type Argument fromKeyK <optional>
toKeyK | null