JsonTree.js - Documentation - Public Functions

Below is a list of all the public API functions that can be called from a JsonTree.js service.

Download Now

v0.8.0 - 20th Mar 2024
Functions

Manage Instances:

refresh( elementId ):

Refreshes a JsonTree.js instance.
Fires: onRefresh
Parameter: elementId: string - The JsonTree.js element ID that should be refreshed.
Returns: Object - The JsonTree.js class instance.

refreshAll():

Refreshes all of the rendered JsonTree.js instances.
Fires: onRefresh
Returns: Object - The JsonTree.js class instance.

render( element, options ):

Renders an element using the options specified.
Parameter: element: Object - The element to render.
Parameter: options: Object - The options to use (refer to "Binding Options" documentation for properties).
Returns: Object - The JsonTree.js class instance.

renderAll():

Finds all new elements and renders them.
Returns: Object - The JsonTree.js class instance.

openAll( elementId ):

Opens all the nodes in a JsonTree.js instance.
Fires: onOpenAll
Parameter: elementId: string - The JsonTree.js element ID that should be updated.
Returns: Object - The JsonTree.js class instance.

closeAll( elementId ):

Closes all the nodes in a JsonTree.js instance.
Fires: onCloseAll
Parameter: elementId: string - The JsonTree.js element ID that should be updated.
Returns: Object - The JsonTree.js class instance.

Destroying:

destroy( elementId ):

Reverts an element to its original state (without render attributes).
Fires: onDestroy
Parameter: elementId: string - The Heat.js element ID to destroy.
Returns: Object - The JsonTree.js class instance.

destroyAll():

Reverts all rendered elements to their original state (without render attributes).
Fires: onDestroy
Returns: Object - The JsonTree.js class instance.

Configuration:

setConfiguration( newConfiguration ):

Sets the specific configuration options that should be used.
Parameter: newConfiguration: Options - All the configuration options that should be set (refer to "Configuration Options" documentation for properties).
Returns: Object - The JsonTree.js class instance.

Additional Data:

getIds():

Returns an array of element IDs that have been rendered.
Returns: string[] - The element IDs that have been rendered.

getVersion():

Returns the version of JsonTree.js.
Returns: string - The version number.