getValue()
Returns the current value of the editor by calling getValue()
on the root instance.
Internally, this traverses the entire instance tree to build the complete JSON structure.
Jedison provides several methods to interact with your editor instance:
getValue()
Returns the current value of the editor by calling getValue()
on the root instance.
Internally, this traverses the entire instance tree to build the complete JSON structure.
setValue(data)
Updates the editor's value with new data by calling setValue()
on the root instance.
data
: The new JSON data to setgetInstance(jsonPath)
Retrieves a specific instance by its JSON path.
Example paths:
'#'
- Root instance'#/property'
- Nested property'#/array/0'
- First item in an arrayshowValidationErrors(errorsList = null)
Displays validation errors in the respective editors.
errorsList
is provided, displays those specific errorsgetErrors()
getErrors(filters = ['error'])
Returns an array of validation error messages from all instances.
filters
: Include only errors with type
that are included in the filter arrayjedison.getErrors(filters = ['error, 'warning'])
[
{
"type": "error",
"path": "#",
"constraint": "minLength",
"messages": [
"Must be at least 4 characters long."
]
},
{
"type": "warning",
"path": "#",
"constraint": "x-my-constraint",
"messages": [
"Value should be equal to \"test\"."
]
}
]
jedison.getErrors(filters = ['error])
[
{
"type": "error",
"path": "#",
"constraint": "minLength",
"messages": [
"Must be at least 4 characters long."
]
}
]
disable()
Disables UI controls
enable()
Enables UI controls
destroy()
Cleans up the editor instance by:
destroy()
on the root instance