# jdjson-editor **Repository Path**: ekber/jdjson-editor ## Basic Information - **Project Name**: jdjson-editor - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-08-01 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Deprecation notice This repo is no longer maintained (see also https://github.com/jdorn/json-editor/issues/800) **Development is continued at https://github.com/json-editor/json-editor** For details please visit https://github.com/json-editor/json-editor/issues/5 --- JSON Editor ===========  JSON Editor takes a JSON Schema and uses it to generate an HTML form. It has full support for JSON Schema version 3 and 4 and can integrate with several popular CSS frameworks (bootstrap, foundation, and jQueryUI). Check out an interactive demo (demo.html): http://jeremydorn.com/json-editor/ Download the [production version][min] (22K when gzipped) or the [development version][max]. [min]: https://raw.github.com/jdorn/json-editor/master/dist/jsoneditor.min.js [max]: https://raw.github.com/jdorn/json-editor/master/dist/jsoneditor.js Requirements ----------------- JSON Editor has no dependencies. It only needs a modern browser (tested in Chrome and Firefox). ### Optional Requirements The following are not required, but can improve the style and usability of JSON Editor when present. * A compatible JS template engine (Mustache, Underscore, Hogan, Handlebars, Swig, Markup, or EJS) * A compatible CSS framework for styling (bootstrap 2/3, foundation 3/4/5, or jqueryui) * A compatible icon library (bootstrap 2/3 glyphicons, foundation icons 2/3, jqueryui, or font awesome 3/4) * [SCEditor](http://www.sceditor.com/) for WYSIWYG editing of HTML or BBCode content * [EpicEditor](http://epiceditor.com/) for editing of Markdown content * [Ace Editor](http://ace.c9.io/) for editing code * [Select2](http://ivaynberg.github.io/select2/) for nicer Select boxes * [Selectize](http://brianreavis.github.io/selectize.js/) for nicer Select & Array boxes * [math.js](http://mathjs.org/) for more accurate floating point math (multipleOf, divisibleBy, etc.) Usage -------------- If you learn best by example, check these out: * Basic Usage Example - http://rawgithub.com/jdorn/json-editor/master/examples/basic.html * Advanced Usage Example - http://rawgithub.com/jdorn/json-editor/master/examples/advanced.html * CSS Integration Example - http://rawgithub.com/jdorn/json-editor/master/examples/css_integration.html The rest of this README contains detailed documentation about every aspect of JSON Editor. For more under-the-hood documentation, check the wiki. ### Initialize ```js var element = document.getElementById('editor_holder'); var editor = new JSONEditor(element, options); ``` #### Options Options can be set globally or on a per-instance basis during instantiation. ```js // Set an option globally JSONEditor.defaults.options.theme = 'bootstrap2'; // Set an option during instantiation var editor = new JSONEditor(element, { //... theme: 'bootstrap2' }); ``` Here are all the available options:
Option | Description | Default Value |
---|---|---|
ajax | If true , JSON Editor will load external URLs in $ref via ajax. |
false |
disable_array_add | If true , remove all "add row" buttons from arrays. |
false |
disable_array_delete | If true , remove all "delete row" buttons from arrays. |
false |
disable_array_reorder | If true , remove all "move up" and "move down" buttons from arrays. |
false |
disable_collapse | If true , remove all collapse buttons from objects and arrays. |
false |
disable_edit_json | If true , remove all Edit JSON buttons from objects. |
false |
disable_properties | If true , remove all Edit Properties buttons from objects. |
false |
form_name_root | The first part of the `name` attribute of form inputs in the editor. An full example name is `root[person][name]` where "root" is the form_name_root. | root |
iconlib | The icon library to use for the editor. See the CSS Integration section below for more info. | null |
no_additional_properties | If true , objects can only contain properties defined with the properties keyword. |
false |
refs | An object containing schema definitions for URLs. Allows you to pre-define external schemas. | {} |
required_by_default | If true , all schemas that don't explicitly set the required property will be required. |
false |
keep_oneof_values | If true , makes oneOf copy properties over when switching. |
true |
schema | A valid JSON Schema to use for the editor. Version 3 and Version 4 of the draft specification are supported. | {} |
show_errors | When to show validation errors in the UI. Valid values are interaction , change , always , and never . |
"interaction" |
startval | Seed the editor with an initial value. This should be valid against the editor's schema. | null |
template | The JS template engine to use. See the Templates and Variables section below for more info. | default |
theme | The CSS theme to use. See the CSS Integration section below for more info. | html |
display_required_only | If true , only required properties will be included by default. |
false |