Back to Website
Show / Hide Table of Contents

Class AuWidgetGallery

A widget that is used to display a list of images and allows you to select an image. For details, you can refer to the Gallery widget topic.

{
  "widgets": [
   {
     "type": "gallery",
     "name": "backgrounds",
     "title": "Background",
     "params": {
       "prompt": "Choose a background image",
       "showTitle": true,
       "items": [{
         "title": "Football",
         "name": "something",
         "previewUrl": "/assets/img/something.jpg"
       }]
     }
   }
  ]
}
Package: ui-framework

Properties

applyEmptyValues

Declaration
applyEmptyValues: boolean
Property Value
Type Description
boolean

emptyValuesText

Declaration
emptyValuesText: string
Property Value
Type Description
string

params

Properties of this widget.

Declaration
params: IGalleryConfig
Property Value
Type Description
IGalleryConfig

Properties of this widget.

value

A gallery item.

Declaration
public value: IGalleryItem
Property Value
Type Description
IGalleryItem

A gallery item.

Methods

checkInitDependenciesWidgets()

Returns an array of widget names, due to which the current widget cannot receive parameters.

Declaration
function checkInitDependenciesWidgets()
Returns
Type Description
string[]

clearSelection()

Resets the selected value.

Declaration
function clearSelection()

exportWidgetData(boolean)

Declaration
function exportWidgetData(force: boolean)
Parameters
Type Name Description
boolean force
Returns
Type Description
Promise<GalleryWidgetData>

resetPreloaderState()

Declaration
function resetPreloaderState()

restoreWidgetFromData(GalleryWidgetData, boolean)

Declaration
function restoreWidgetFromData(widgetData: GalleryWidgetData, force: boolean)
Parameters
Type Name Description
GalleryWidgetData widgetData
boolean force
Returns
Type Description
Promise<void>

setSelectedItem(string | number)

Select gallery item by its index or name

Declaration
function setSelectedItem(itemIndexOrName: string | number)
Parameters
Type Name Description
string | number itemIndexOrName

index or name of item that should be selected

showPreloader(boolean, string | string[], number)

Shows a preloader.

"onClick": [
  "{{#function main.showPreloader(true, 'Creating print files...')}}",
  "{{#function $['editor'].getHiResImages(800,800)}}",
  "{{#function main.showPreloader(false)}}"
]
Declaration
function showPreloader(isPreload: boolean, message: string | string[], timeout: number)
Parameters
Type Name Description
boolean isPreload

If true, enables the preloader.

string | string[] message

A text message that appears next to the preloader.

number timeout

showToast(string, number)

Shows a toast.

return editor.loadUserInfo(data)
    .catch(err => {
        this.widget.showToast("Error: Invalid data");
        console.log(err);
    });
Declaration
function showToast(data?: string, duration?: number)
Parameters
Type Name Description
string data

A string message to display in the toast.

number duration

Defines how long to show the toast for.

Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2024 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback