Skip to content

support edit json button at array level#1604

Open
skyshore2001 wants to merge 2 commits intojson-editor:masterfrom
skyshore2001:issue1054
Open

support edit json button at array level#1604
skyshore2001 wants to merge 2 commits intojson-editor:masterfrom
skyshore2001:issue1054

Conversation

@skyshore2001
Copy link
Copy Markdown
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