JsonTree.js - Documentation - Binding Options - Custom Triggers

Below is a list of all the binding options custom triggers supported in JsonTree.js, which are fired when specific actions occur.

Download Now

v4.5.0 - 8rd Nov 2024
Option Triggers

For Rendering:

options.events.onRefresh( jsonTreeElement ):

Fires when a rendered element is refreshed.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onBeforeRenderComplete( jsonTreeElement ):

Fires before the rendering of the JsonTree.js of an element.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onRenderComplete( jsonTreeElement ):

Fires when the rendering of the JsonTree.js for an element is complete.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onDestroy( jsonTreeElement ):

Fires when the element is destroyed (reverted to its original state).
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onSelectionChange( jsonTreeElement ):

Fires when the selected items in the element are changed.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

For Value Rendering:

options.events.onBooleanRender( jsonTreeElement, valueElement ):

Fires when a boolean value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onDecimalRender( jsonTreeElement, valueElement ):

Fires when a decimal value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onNumberRender( jsonTreeElement, valueElement ):

Fires when a number value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onStringRender( jsonTreeElement, valueElement ):

Fires when a string value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onDateRender( jsonTreeElement, valueElement ):

Fires when a date value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onFunctionRender( jsonTreeElement, valueElement ):

Fires when a function value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onNullRender( jsonTreeElement, valueElement ):

Fires when a null value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onUnknownRender( jsonTreeElement, valueElement ):

Fires when an unknown value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onBigIntRender( jsonTreeElement, valueElement ):

Fires when an bigint value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onSymbolRender( jsonTreeElement, valueElement ):

Fires when an symbol value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onGuidRender( jsonTreeElement, valueElement ):

Fires when an GUID value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onColorRender( jsonTreeElement, valueElement ):

Fires when an color value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onRegExpRender( jsonTreeElement, valueElement ):

Fires when an RegExp value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onUrlRender( jsonTreeElement, valueElement ):

Fires when an Url value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onImageRender( jsonTreeElement, valueElement ):

Fires when an image value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onEmailRender( jsonTreeElement, valueElement ):

Fires when an email value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onLambdaRender( jsonTreeElement, valueElement ):

Fires when a lambda function value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: valueElement: 'Object' - The value element that was rendered.

options.events.onCustomDataTypeRender( jsonTreeElement, value ):

Fires when a lambda function value is rendered.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: value: 'Object' - The JSON property/index value.
Returns: Object | boolean' - A false flag that states if custom type rendering is disabled for the value, or the "CustomDataType" object format for a custom type.

For Data:

options.events.onCopyAll( jsonTreeElement, data ):

Fires when all the JSON is copied to the clipboard.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: data: 'string' - The JSON that was copied to the clipboard.

options.events.onOpenAll( jsonTreeElement ):

Fires when all the JSON nodes are opened.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onCloseAll( jsonTreeElement ):

Fires when all the JSON nodes are closed.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onBackPage( jsonTreeElement ):

Fires when moving back a page (when showing arrays as pages).
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onNextPage( jsonTreeElement ):

Fires when moving forward a page (when showing arrays as pages).
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onSetJson( jsonTreeElement ):

Fires when the JSON data is changed.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onJsonEdit( jsonTreeElement ):

Fires when a property name/value is edited.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onExport( jsonTreeElement ):

Fires when the JSON being viewed is exported.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.

options.events.onFullScreenChange( jsonTreeElement, flag ):

Fires when all the JSON is copied to the clipboard.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: flag: 'boolean' - States if full-screen mode is enabled.

options.events.onCopyJsonReplacer( key, value ):

Fires when the "Copy" button is pressed, and gets the result that should be used for values when copying the JSON to the clipboard.
Parameter: key: 'string' - The name of the property.
Parameter: value: 'Object' - The value of the property.

For Clicking:

options.events.onValueClick( jsonTreeElement, value, type ):

Fires when a a value is clicked.
Parameter: jsonTreeElement: 'Object' - The JsonTree DOM element.
Parameter: value: 'Object' - The value.
Parameter: type: 'string' - The value type.