Back to Website
Show / Hide Table of Contents

Class AuWidgetImageCarousel

A widget that is used to display multiple images arranged as an image carousel. For details, you can refer to the ImageCarousel widget topic.

{
  "widgets": [
    {
      "name": "images",
      "type": "image-carousel",
      "params": {
        "images": [
          {
            "title": "Front Side",
            "url": "http://example.com/some/url/1/front.jpg"
          },
          {
            "title": "Back Side",
            "url": "http://example.com/some/url/1/back.jpg"
          }
        ]
      }
    }
  ]
}
Package: ui-framework

Properties

currentImageTitle

The title of the current image.

Declaration
currentImageTitle: string = ""
Property Value
Type Description
string

The title of the current image.

images

An array of images displayed in the widget.

Declaration
images: Array<IImage> = []
Property Value
Type Description
Array<IImage>

An array of images displayed in the widget.

imagesCount

The number of images displayed in the widget.

Declaration
imagesCount: number = 0
Property Value
Type Description
number

The number of images displayed in the widget.

params

Properties of the widget.

Declaration
params: IImageCarouselConfig
Property Value
Type Description
IImageCarouselConfig

Properties of the widget.

Methods

backImage()

go to previous image

Declaration
function backImage()

checkInitDependenciesWidgets()

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

Declaration
function checkInitDependenciesWidgets()
Returns
Type Description
string[]

exportWidgetData(boolean)

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

loadedCountChanged()

Declaration
function loadedCountChanged()

nextImage()

go to next image

Declaration
function nextImage()

resetPreloaderState()

Declaration
function resetPreloaderState()

restoreWidgetFromData(ImageCarouselData, boolean)

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

selectImage(number)

select image by index

Declaration
function selectImage(index: number)
Parameters
Type Name Description
number index

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