diff --git a/src/editor.js b/src/editor.js index 3ca319d2e..279038199 100644 --- a/src/editor.js +++ b/src/editor.js @@ -46,8 +46,12 @@ JSONEditor.AbstractEditor = Class.extend({ this.path = options.path || 'root'; this.formname = options.formname || this.path.replace(/\.([^.]+)/g,'[$1]'); if(this.jsoneditor.options.form_name_root) this.formname = this.formname.replace(/^root\[/,this.jsoneditor.options.form_name_root+'['); - this.key = this.path.split('.').pop(); this.parent = options.parent; + if (options.parent) { + this.key = this.path.split(".").slice(options.parent.path.split(".").length).join("."); + } else { + this.key = this.path; + } this.link_watchers = [];