插件 jQuery.json editor 中文API文档

🌙
手机阅读
本文目录结构

插件 jQuery.json editor 中文API文档 https://github.com/jillix/jquery-json-editor jQuery JSON Editor

A jQuery library for editing JSON data.

Documentation

$.fn.jsonEdit(opt_options)

Initializes the JSON editor on selected elements.

Params

  • Object opt_options: An object containing the following fields:
  • data (Object): The input JSON data (default: {}).
  • schema (Object): The JSON data schema. The provided object will be merged with default schema.
  • autoInit (Boolean): If true, the forms will be added by default (default: true).

Return

  • Object The JSON editor object containing:
  • labels (Object): An object with UI elements used for labels.
  • groups (Object): An object with UI elements used for groups.
  • inputs (Object): An object with UI elements used for inputs.
  • container (jQuery): A jQuery object being the container of the JSON editor.
  • createGroup (Function): Creates a form group.

createGroup(field)

Creates a form group and returns the jQuery object.

Params

  • Object field: The field object.

Return

  • jQuery The jQuery object form.

addControls(path)

Adds delete button control.

Params

  • String path: The field path.

add(path, data)

Adds new elements in arrays.

Params

  • String|jQuery path: The path to the field or the jQuery object.
  • Object data: Data to add.

delete(path)

Deletes elements from arrays.

Params

  • jQuery path: The element to be deleted.

getValue(fieldPath)

Returns the value of field.

Params

  • String fieldPath: The path to the value.

Return

  • Anything The value taken from data.

initUi()

Creates the form from JSON data.

getData()

Collects data from form inputs and return the data object.

Return

  • Object The object containing data taken from forms.

How to contribute

  1. File an issue in the repository, using the bug tracker, describing the contribution you’d like to make. This will help us to get you started on the right foot.
  2. Fork the project in your account and create a new branch: your-great-feature.
  3. Commit your changes in that branch. Please see the developer guidelines in CONTRIBUTING.md.
  4. Open a pull request, and reference the initial issue in the pull request message.

License

See the LICENSE file.

AXIHE / 精选资源

浏览全部教程

面试题

学习网站

前端培训
自己甄别

前端书籍

关于朱安邦

我叫 朱安邦,阿西河的站长,在杭州。

以前是一名平面设计师,后来开始接接触前端开发,主要研究前端技术中的JS方向。

业余时间我喜欢分享和交流自己的技术,欢迎大家关注我的 Bilibili

关注我: Github / 知乎

于2021年离开前端领域,目前重心放在研究区块链上面了

我叫朱安邦,阿西河的站长

目前在杭州从事区块链周边的开发工作,机械专业,以前从事平面设计工作。

2014年底脱产在老家自学6个月的前端技术,自学期间几乎从未出过家门,最终找到了满意的前端工作。更多>

于2021年离开前端领域,目前从事区块链方面工作了