Editor
The widget can be used to show any kind of text like JSON or scripting code.
Model
{
"type": "editor",
"content": {},
"contentToCompare" : {},
"language" : "json"
}
Name | Description |
---|---|
|
Primary editor content. This can be either text or JSON. |
|
Setting this property activates the editor’s compare functionality which shows the difference
between the |
|
The language setting is used to activate the editor’s syntax coloring and checking. Supported languages:
|
Editor Options
See Editor Options for all the available editor options.
{
"editorOptions": {}
}
When the editor is used to compare content, either of the panels can be configured to be editable or read-only by
setting the readOnly
and originalEditable
options as follows:
Editable panels | readOnly |
originalEditable |
---|---|---|
Both panels |
false |
true |
Neither panel |
true |
false |
Only the |
true |
true |
Only the |
false |
false |
onContentChange
In case onContentChange
is defined this will be invoked every time the textual content of the widget is updated. Can
be used together with the send
action pipeline to send the content to an other widget.
{
"onContentChange": [
{
"type": "send",
"to": "Place here the ID of the widget"
}
]
}
Update Behavior
The update logic of this widget accepts a payload, which is a string or a JSON element. In case the value of the
payload
is a string, the value will be used to update the content
in the model. When the language
in the model
model is set to json
, the widget tries to convert the string into a JSON element. In case the JSON conversion fails,
the initial payload
string value will be used to update the content
in the model.
When the payload
is a JSON object, the widget uses the fields content
and language
to update the fields in the
model accordingly. In case the payload
does not contain the content
field, the JSON object in the payload
will be
used to update the content
in the model. When the content
field in the payload is a string and the language
field
in the model or payload is set to json
, the widget tries to convert the value of the content
in the payload
to a
JSON element.