Search.../

onItemClicked( )

Adds an event handler that runs when an item in a quick action bar is clicked.

Syntax

function onItemClicked(handler: QuickActionBarItemClickedEventHandler): QuickActionBar
handler: function QuickActionBarItemClickedEventHandler(event: QuickActionBarItemClickedEvent): void

onItemClicked Parameters

NAME
TYPE
DESCRIPTION
handler

The name of the function or the function expression to run when a quick action bar item is clicked.

Returns

The quick action bar that triggered the event.

Return Type:

QuickActionBarItemClickedEventHandler Parameters

NAME
TYPE
DESCRIPTION
event

The event that has occurred.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Get the information of the item that was clicked

Copy Code
1$w("#myQuickActionBar").onItemClicked( (event) => {
2 let itemType = event.item.itemType; // "search"
3 let itemLabel = event.item.label; // "Search"
4 let itemLink = event.item.link; // "https://www.google.com/search?q=wix"
5
6 let imageSrc = event.itemIndex; // 3
7} );