monster.ui.renderJSON()

Syntax

monster.ui.renderJSON(data, target[, args]);

Parameters

  • data (mandatory)

Type: JSON

Data to Pretty Print

  • target (mandatory)

Type: jQuery object

Template on which the method will be applied. It will automatically fill that div with the JSON viewer.

  • args (optional)

Type: Object

Default: { sort: false, level: 2 }

Let you specify a map of options for this helper.

  • args.sort (optional) Type: Boolean Default: false

Sets whether the keys will be sorted alphabetically or not.

  • args.level (optional) Type: Integer Default: 2

Set the number of level that will be expanded automatically.

  • args.theme (optional) Type: String Default: light

Choose a theme for the JSON viewer. 'light' or 'dark' are the only accepted options at the moment. Choose dark for a dark background :)

Description

This helper will use the data provided in parameter and show it in a JSON viewer in the UI, in the container provided

Edit this page here