json-editor icon indicating copy to clipboard operation
json-editor copied to clipboard

editor doesn't have setValue function and on function

Open GusGus2008 opened this issue 9 years ago • 1 comments

image var editor = new JSONEditor(document.getElementById(name + 'JsonEditor'), {}); $jsonEditorDiv.data("editor", editor); $jsonEditorDiv.data("textarea-dom", $(this).find("textarea")); if (jsonStr != null && jsonStr.length > 0) { var json = null; try { json = JSON.parse(jsonStr); } catch (ex) { console.log(ex.message); json = null; }

                if (json != null) {
                    editor.setValue(json);
                }
            }

            var $textarea = $(this).find("textarea");
            editor.on("change", function (e) {

            });

GusGus2008 avatar Nov 08 '16 06:11 GusGus2008

+1 Using editor.set() and editor.get() solve issue for me

and-and avatar Apr 06 '18 12:04 and-and