Item class
đ Descriptionâ
The Item class is an abstract class for creating item types for collections. Item collections are used to enable the user to create lists with items of a certain type. For example, options in a dropdown list.
đ Applicable decoratorsâ
The following decorators can be applied in this class:
Property decorators âšī¸â
Method decorators âšī¸â
đ constructorâ
Creates a new Item instance.
Signatureâ
constructor(): Item
Return valueâ
Returns a reference to the new Item instance.
đī¸ Fieldsâ
đˇī¸ collectionâ
Retrieves a reference to the parent collection provider.
Typeâ
đˇī¸ editorâ
Retrieves the EditorOrchestrator instance used to define the controls to manage the item.
You should use the @editor decorator to mark the method that implements the controls.
Typeâ
đˇī¸ idâ
Retrieves the identifier of the item.
Typeâ
string
đˇī¸ indexâ
Retrieves the zero-based index of the item in the collection.
Typeâ
number
đˇī¸ isFirstâ
Retrieves if the item is the first item in the collection.
Typeâ
boolean
đˇī¸ isLastâ
Retrieves if the item is the last item in the collection.
Typeâ
boolean
đˇī¸ predecessorâ
Retrieves a reference to the predecessor item (if any).
Typeâ
Item | undefined
đˇī¸ refâ
Retrieves a reference to the parent of the collection.
The reference is set using the reference argument of the of function.
Typeâ
NodeBlock | ConditionBlock | Item
đˇī¸ successorâ
Retrieves a reference to the successor item (if any).
Typeâ
Item | undefined
âļī¸ Methodsâ
đ§ deleteâ
Deletes the item.
Signatureâ
delete(): this
Return valueâ
Returns a reference to the Item instance to allow chaining.
đ§ refreshâ
Refreshes the item.
Signatureâ
refresh(type?: "icon" | "name"): void
Parametersâ
| Name | Type | Optional | Description |
|---|---|---|---|
type | "icon" | "name" | Yes | Specifies what to refresh. |