Skip to main content

au-widget-html/au-widget-html

Classes​

AuWidgetHtml​

A widget that is used to display text and HTML markup.

For details, you can refer to the Html widget topic.

The following example implements a SPAN element.

{
"widgets": [
{
"name": "simple",
"type": "html",
"title": "Simple span",
"params": {
"template": {
"<>": "span",
"text": "Hello world"
}
}
}
]
}

This will result in:

<span>Hello world</span>

Extends​

Implements​

Constructors​

Constructor​
new AuWidgetHtml(): AuWidgetHtml;
Returns​

AuWidgetHtml

Inherited from​

AuBaseWidget.constructor

Properties​

params​
params: IHtmlConfig;

Properties of the widget.

Overrides​

AuBaseWidget.params

Methods​

checkInitDependenciesWidgets()​
checkInitDependenciesWidgets(): string[];

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

Returns​

string[]

Inherited from​

AuBaseWidget.checkInitDependenciesWidgets

exportWidgetData()​
exportWidgetData(force): Promise<HtmlWidgetData>;
Parameters​
ParameterType
forceboolean
Returns​

Promise<HtmlWidgetData>

Implementation of​

IRestorableWidget.exportWidgetData

resetPreloaderState()​
resetPreloaderState(): void;
Returns​

void

Inherited from​

AuBaseWidget.resetPreloaderState

restoreWidgetFromData()​
restoreWidgetFromData(widgetData, force): Promise<void>;
Parameters​
ParameterType
widgetDataHtmlWidgetData
forceboolean
Returns​

Promise<void>

Implementation of​

IRestorableWidget.restoreWidgetFromData

showPreloader()​
showPreloader(
isPreload,
message?,
timeout?): void;

Shows a preloader.

"onClick": [
"{{#function main.showPreloader(true, 'Creating print files...')}}",
"{{#function $['editor'].getHiResImages(800,800)}}",
"{{#function main.showPreloader(false)}}"
]
Parameters​
ParameterTypeDefault valueDescription
isPreloadbooleanundefinedIf true, enables the preloader.
messagestring | string[]...A text message that appears next to the preloader.
timeoutnumber5-
Returns​

void

Inherited from​

AuBaseWidget.showPreloader

showToast()​
showToast(data?, duration?): void;

Shows a toast.

return editor.loadUserInfo(data)
.catch(err => {
this.widget.showToast("Error: Invalid data");
console.log(err);
});
Parameters​
ParameterTypeDescription
data?stringA string message to display in the toast.
duration?numberDefines how long to show the toast for.
Returns​

void

Inherited from​

AuBaseWidget.showToast

References​

widget​

Renames and re-exports AuWidgetHtml

Was this page helpful?