ItemView.addAction method
ItemView › addAction
Official
Add an action to the item view.Signature:
addAction(icon: string, title: string, callback: (evt: MouseEvent) => unknown): HTMLElementParameters:
| Parameter | Type | Description |
|---|---|---|
| icon | string | The icon of the action. |
| title | string | The title of the action. |
| callback | (evt: MouseEvent) => unknown | The callback to call when the action is clicked. |
Returns: HTMLElement — The DOM element of the action. To extract the constructor type, use ExtractConstructor<ItemView>.
Since: 1.1.0
Example:
const action = itemView.addAction('dice', 'foo', () => { console.log('bar');});