Event handlers for view design-time preview
Function | Description |
---|---|
getHTMLSnippet() |
Returns the HTML snippet as a String for the view design time rendering. If an
HTML preview file has also been set on the view, then the content of
this.htmlSnippet is automatically set and returned. This function can be overridden
to modify the snippet or, if an HTML preview is not specified, supply a template via coding. |
createPreview(containingDiv, labelText,
callback) |
Creates the preview for the view at design time. If an HTML snippet has been
supplied (by either a managed asset or the getHTMLSnippet() function ), then
containingDiv will have these contents:
|
destroyPreview() |
Function called when the preview of the view instance is no longer being used. Use this function to clean up the resources that preview used when it was active. |
propertyChanged(propertyName, propertyValue) |
Function called when the view instance is first
initialized and when a property changes. These changes are similar
to those returned by the modelChanged function except
the values are mapped to runtime values where possible. Some model
facets are combined into one grouping. For example, one If the data type is a URL, for example in the case of a stock image binding, and a managed asset is chosen, then propertyValue is resolved to a usable URL or null if not found. If the configuration option is responsive, the effective value is passed in, which could be inherited from another screen size setting. If the value is a localization key, the value passed is the resolved value for the current locale. If the user selects a different screen
size setting, the function is called with the property name
|
modelChanged(propertyName, propertyValue) |
Function called when the model changes. Notification is triggered by configuration data changes, or changes to the bound data (via the @binding property name) and layout item control ID(@layoutItemId).
|
this.context
exists
and can be called to do various things:
this.context | Description |
---|---|
context.device |
Provides the currently selected device in
the editor. It is recommended that you use the |
context.getManagedAssetUrl(fileName, assetType, projectAcronym,
returnWithoutAssetName, pathInZip) |
Returns a URL that points to the managed asset that is specified by
fileName.
|