CodeAPI

QuickActionBarItemClickedEvent

Event that is fired when a quick action bar item is clicked.

Table of Contents

PROPERTIES

?
Store values associated with an object.
contextGets the context of the event on a repeated element.
itemGets the gallery item.
itemIndexGets the quick action bar item's index.
targetGets the element that the event was fired on.
typeGets the type of event that was fired.

OBJECTS

?
Objects used when setting, getting, or calling the properties and methods listed above.
QuickActionBarItemAn object representing a quick action bar item.

MIXES IN

?
Where some functionality is inherited from.
$w.Event

context

Gets the context of the event on a repeated element.

Description

An event's context contains information about the circumstances surrounding the firing of the event. The context property only appears in events on repeated elements.

You can use the evnet context with $w.at() to get a selector function which selects items from a specific repeater item. It contains an object with one key:value pair. The key is "itemId" and the value is the ID of the repeated item on which the event occurred.

Syntax

get context(): EventContext

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Event

Examples

Get the context of the event

// non-repeater event

$w("#myElement").onEvent( (event) => {
  let type = event.context.type; // "GLOBAL_SCOPE"
} );


// repeater event

$w("#myRepeatedElement").onEvent( (event) => {
  let $item = $w.at(event.context)
  $item("#anotherRepeatedElement").value = "new value";

  let itemId = event.context.itemId;  // "item1"
} );

item

Gets the gallery item.

Syntax

get item(): QuickActionBarItem

Examples

Get the quick action bar item that was clicked

$w("#myQuickActionBar").onItemClicked( (event) => {
  let itemType = event.item.itemType; // "search"
  let itemLabel = event.item.label;   // "Search"
  let itemLink = event.item.link;     // "https://www.google.com/search?q=wix"
} );

itemIndex

Gets the quick action bar item's index.

Syntax

get itemIndex(): number
TYPE
?
The kind of data the property stores.
number

Examples

Get the index of the quick action bar item that was clicked

$w("#myQuickActionBar").onItemClicked( (event) => {
  let imageSrc = event.itemIndex; // 3
} );

target

Gets the element that the event was fired on.

Note

When using the target to get the value of a text input or text box in an onKeyPress event handler, you may receive the value of the element before the key was pressed. To get the text input or text box's updated value, use the updatedTargetValue property of the event handler's event parameter.

Syntax

get target(): Element
TYPE
?
The kind of data the property stores.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Event

Examples

Get the ID of the target element

$w("#myElement").onEvent( (event) => {
  let targetId = event.target.id;  // "myElement"
} );

type

Gets the type of event that was fired.

Syntax

get type(): string
TYPE
?
The kind of data the property stores.
string

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Event

Examples

Get the type of the event

$w("#myElement").onEvent( (event) => {
  let eventType = event.type; // "click"
} );

QuickActionBarItem

An object representing a quick action bar item.

Description

The itemType is one of:

  • "3dots"
  • "3dotsvertical"
  • "about"
  • "add"
  • "address"
  • "arrowdown"
  • "arrowup"
  • "blog"
  • "booking"
  • "briefcase"
  • "clock"
  • "clothes"
  • "cloud"
  • "contactform"
  • "creditcard"
  • "crown"
  • "currency"
  • "earth"
  • "ecom"
  • "email"
  • "facebook"
  • "flag"
  • "flickr"
  • "freebutton"
  • "gallery"
  • "googleplus"
  • "hamburgermenu"
  • "heart"
  • "home"
  • "hot"
  • "hotel"
  • "hotsale"
  • "icecream"
  • "instagram"
  • "lightning"
  • "link"
  • "linkedin"
  • "music"
  • "new"
  • "page"
  • "phone"
  • "pinterest"
  • "present"
  • "register"
  • "restaurant"
  • "rocket"
  • "sale"
  • "search"
  • "shoppingcart"
  • "signup"
  • "smile"
  • "social"
  • "speaker"
  • "star"
  • "ticket"
  • "twitter"
  • "vimeo"
  • "vk"
  • "yelp"
  • "youtube"

Syntax

type QuickActionBarItem = {
  itemType: string
  label: string
  link: string
}
MEMBERS
?
The kind of data the property stores.
itemType
string
The quick action bar item type.
label
string
The quick action bar item label.
link
string
The quick action bar item link.