Class 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>
Package: ui-framework
Properties
params
Properties of the widget.
Declaration
params: IHtmlConfig
Property Value
Type | Description |
---|---|
IHtmlConfig | Properties of the widget. |
Methods
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<HtmlWidgetData> |
resetPreloaderState()
Declaration
function resetPreloaderState()
restoreWidgetFromData(HtmlWidgetData, boolean)
Declaration
function restoreWidgetFromData(widgetData: HtmlWidgetData, force: boolean)
Parameters
Type | Name | Description |
---|---|---|
HtmlWidgetData | widgetData | |
boolean | force |
Returns
Type | Description |
---|---|
Promise<void> |
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 |
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. |