Skip to main content

au-widget-data-driven-editor/au-widget-data-driven-editor

Classes

AuWidgetDataDrivenEditor

Represents a Data-Driven Editor widget, enabling users to fill out pre-configured forms and modify designs accordingly.

For details, you can refer to the Data-Driven Editor widget topic.

{
"widgets": [
{
"name": "dde",
"type": "data-driven-editor",
"params": {
"config": {
"design": {
"designId": "68e74591f70c72b7ce14f889",
"dataSetId": "68a24768aa00e6f0203564dc"
},
"settings": {
"lang": "en",
"allowManipulations": false,
"itemsSnapLines": true
},
"renderer": {
"watermarkEnabled": true,
"watermarkOpacity": 0.5,
"format": "jpeg"
}
}
}
}
]
}

Extends

Implements

Properties

idStr
idStr: string;

Product ID string

Implementation of

IWidgetDataDrivenEditor.idStr

isValid
isValid: boolean;

true if form of data driven editor is valid

Implementation of

IWidgetDataDrivenEditor.isValid

pdfUrl
pdfUrl: string;

URL for download PDF file

Implementation of

IWidgetDataDrivenEditor.pdfUrl

previewUrlLink: string;

URL preview image (First page)

Implementation of

IWidgetDataDrivenEditor.previewUrlLink

previewUrls
previewUrls: string[] = [];

URL's preview images

Implementation of

IWidgetDataDrivenEditor.previewUrls

stateId
stateId: string;

Saved product ID

Implementation of

IWidgetDataDrivenEditor.stateId

userId
userId: string;

Current user ID

Implementation of

IWidgetDataDrivenEditor.userId

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

createIdStr()
createIdStr(): Promise<string>;

Create id string from values from data driven form

Returns

Promise<string>

Implementation of

IWidgetDataDrivenEditor.createIdStr

createPdfPreview()
createPdfPreview(config?): Promise<string>;

Create link for download preview PDF file

Parameters
ParameterTypeDescription
config?IRendererConfigRender configuration
Returns

Promise<string>

Implementation of

IWidgetDataDrivenEditor.createPdfPreview

createPreview()
createPreview(config?): Promise<string[]>;

Create preview images

Parameters
ParameterTypeDescription
config?IRendererConfigRender configuration
Returns

Promise<string[]>

Implementation of

IWidgetDataDrivenEditor.createPreview

exportWidgetData()
exportWidgetData(force): Promise<Partial<IEditorConfig>>;
Parameters
ParameterType
forceboolean
Returns

Promise<Partial<IEditorConfig>>

Implementation of

IRestorableWidget.exportWidgetData

getFormData()
getFormData(config): Record<string, string>;

Allow to get current data of form

Parameters
ParameterType
configIFormDataConfig
Returns

Record<string, string>

Implementation of

IWidgetDataDrivenEditor.getFormData

getInvalidFieldsNames()
getInvalidFieldsNames(): string[];

Allows you to get the names of fields that have not been validated.

Returns

string[]

resetPreloaderState()
resetPreloaderState(): void;
Returns

void

Inherited from

AuBaseWidget.resetPreloaderState

restoreWidgetFromData()
restoreWidgetFromData(data, force): Promise<void>;
Parameters
ParameterType
dataIEditorConfig
forceboolean
Returns

Promise<void>

Implementation of

IRestorableWidget.restoreWidgetFromData

saveProduct()
saveProduct(asNew): Promise<void>;

Saved or updated current product to private storage

Parameters
ParameterType
asNewboolean
Returns

Promise<void>

Implementation of

IWidgetDataDrivenEditor.saveProduct

setEditorConfig()
setEditorConfig(config): Promise<void>;

Sets the configuration of data driven editor

Parameters
ParameterType
configIEditorConfig
Returns

Promise<void>

Implementation of

IWidgetDataDrivenEditor.setEditorConfig

setLang()
setLang(lang): void;

Sets the language of data driven editor

Parameters
ParameterType
langstring
Returns

void

setUserInfo()
setUserInfo(userInfo): void;

Allow to set user info

Parameters
ParameterType
userInfoRecord<string, string>
Returns

void

Implementation of

IWidgetDataDrivenEditor.setUserInfo

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

updateToken()
updateToken(token): void;

Update the token for data driven editor.

Parameters
ParameterType
tokenstring
Returns

void

Deprecated
validate()
validate(): boolean;

Validate form in editor

Returns

boolean

Implementation of

IWidgetDataDrivenEditor.validate

References

widget

Renames and re-exports AuWidgetDataDrivenEditor

Was this page helpful?