Search.../

options

Sets or gets the options in the thumbnail group.

Description

options is an array of objects, each representing an option available to a user.

Type:

Array<option>Read & Write
NAME
TYPE
DESCRIPTION
label
string

The label of the thumbnail option, optionally displayed below the thumbnail. Maximum 120 chars.

value
string

The value of the thumbnail option. This is what you use in code.

Was this helpful?

Get the list of options and the first option's label and value from a thumbnail group

Copy Code
1let ThumbnailGroupOptions = $w("#myThumbnails").options;
2
3let firstLabel = ThumbnailGroupOptions[0].label; // "First Label"
4let firstValue = ThumbnailGroupOptions[0].value; // "first_value"
Set the list of options for a thumbnail group

Copy Code
1$w("#myThumbnails").options = [
2 {"label": "Who's on first!", "value": "first"},
3 {"label": "What's on second", "value": "second"},
4 {"label": "I Don't Know is on third", "value": "third"}
5];
Add an option to a thumbnail group

Copy Code
1let opts = $w("#myThumbnails").options;
2opts.push({"label": "New Label", "value": "New Value"});
3$w("#myThumbnails").options = opts;