$w.QuickActionBarItemClickedEvent

$w.QuickActionBarItemClickedEvent

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

Mixes In

$w.Event

Contents

context Gets the context of the event on a repeated element.
item Gets the gallery item.
itemIndex Gets the quick action bar item's index.
target Gets the element that the event was fired on.
type Gets the type of event that was fired.
QuickActionBarItem An object representing a quick action bar item.
context

context

Gets the context of the event on a repeated element.

Syntax

get context(): Object

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.

Type

EventContext

Examples

Get the context of the event

Ly8gbm9uLXJlcGVhdGVyIGV2ZW50CgokdygiI215RWxlbWVudCIpLm9uRXZlbnQoIChldmVudCkgPT4gewogIGxldCB0eXBlID0gZXZlbnQuY29udGV4dC50eXBlOyAvLyAiR0xPQkFMX1NDT1BFIgp9ICk7CgoKLy8gcmVwZWF0ZXIgZXZlbnQKCiR3KCIjbXlSZXBlYXRlZEVsZW1lbnQiKS5vbkV2ZW50KCAoZXZlbnQpID0+IHsKICBsZXQgJGl0ZW0gPSAkdy5hdChldmVudC5jb250ZXh0KQogICRpdGVtKCIjYW5vdGhlclJlcGVhdGVkRWxlbWVudCIpLnZhbHVlID0gIm5ldyB2YWx1ZSI7CgogIGxldCBpdGVtSWQgPSBldmVudC5jb250ZXh0Lml0ZW1JZDsgIC8vICJpdGVtMSIKfSApOwo=
// 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"
} );

Mixed In From

$w.Event

item

item

Gets the gallery item.

Syntax

get item(): QuickActionBarItem

Type

QuickActionBarItem

Examples

Get the quick action bar item that was clicked

JHcoIiNteVF1aWNrQWN0aW9uQmFyIikub25JdGVtQ2xpY2tlZCggKGV2ZW50LCAkdykgPT4gewogIGxldCBpdGVtVHlwZSA9IGV2ZW50Lml0ZW0uaXRlbVR5cGU7IC8vICJzZWFyY2giCiAgbGV0IGl0ZW1MYWJlbCA9IGV2ZW50Lml0ZW0ubGFiZWw7ICAgLy8gIlNlYXJjaCIKICBsZXQgaXRlbUxpbmsgPSBldmVudC5pdGVtLmxpbms7ICAgICAvLyAiaHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS9zZWFyY2g/cT13aXgiCn0gKTsK
$w("#myQuickActionBar").onItemClicked( (event, $w) => {
  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

itemIndex

Gets the quick action bar item's index.

Syntax

get itemIndex(): Number

Type

Number

Examples

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

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

target

Gets the element that the event was fired on.

Syntax

get target(): string

Type

Element

Examples

Get the ID of the target element

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

Mixed In From

$w.Event

type

type

Gets the type of event that was fired.

Syntax

get type(): string

Type

String

Examples

Get the type of the event

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

Mixed In From

$w.Event

QuickActionBarItem

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"

Properties

itemType String The quick action bar item type.
label String The quick action bar item label.
link String The quick action bar item link.