12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <title>table-confirm-delete</title>
- <script src="../../dist/jsoneditor.js"></script>
- </head>
- <body>
- <textarea class="debug" cols="30" rows="10"></textarea>
- <button class='get-value'>Get Value</button>
- <div class='container'></div>
- <script>
- var container = document.querySelector('.container');
- var debug = document.querySelector('.debug');
- var schema = {
- "type": "array",
- "format": "table",
- "title": "Nodes",
- "items": {
- "type": "object",
- "title": "Node",
- "properties": {
- "node": {
- "type": "string",
- "title": "I am a node"
- }
- }
- }
- };
- var editor = new JSONEditor(container, {
- schema: schema
- });
- // editor.options.prompt_before_delete = false;
- document.querySelector('.get-value').addEventListener('click', function () {
- debug.value = JSON.stringify(editor.getValue());
- });
- </script>
- </body>
- </html>
|