Skip to content

support edit json button at array level #1604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

skyshore2001
Copy link
Contributor

Q A
Is bugfix?
New feature? ✔️
Is backward-compatible? ✔️
Tests pass? N.A.
Fixed issues #1054 Cannot edit JSON at the array level (JSON button only available for array items)
Updated README/docs?
Added CHANGELOG entry?

editjson

TEST CODE:

var startval = [
  {title: "A", arr: [1,2,3]},
  {title: "B", arr: [4,5]},
  {title: "C"},
  {title: "D"},
];

// Initialize the editor with a JSON schema
var editor = new JSONEditor(document.getElementById('editor_holder'),{
  schema: {
    type: "array",
    //format: "table",
    //format: "tabs-top",
    format: "tabs",
    items: {
      type: "object",
      headerTemplate: "{{self.title}}",
      properties: {
        title: {
          type: "string",
        },
        arr: {
          type: "array",
          format: "table",
          items: {
            type: "integer"
          }
        }
      }
    }
  },
  startval: startval,

  theme: "spectre",
  iconlib: "spectre",
  remove_empty_properties: true,
  enable_array_copy: true,
  array_controls_top: true,
  //use_default_values: false,
  show_opt_in: true,
});

document.getElementById('submit').addEventListener('click',function() {
  console.log(editor.getValue());
});

issue#1054 Cannot edit JSON at the array level (JSON button only available for array items)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant