mxGraph loading from XML but cant insert element after it is loaded

here is the code

onSave(){ var encoder = new mxCodec(); var result = encoder.encode(this.graph.getModel()); this.dataToSave = mxUtils.getXml(result); }        onLoad(){          var doc = mxUtils.parseXml(this.dataToSave);     var codec = new mxCodec(doc);     codec.decode(doc.documentElement, this.graph.getModel());     } 

but at the end it wont add something like this note:it will add it before the load button is clicked

this.graph.insertVertex(this.g7, 'c3', this.getGroup(1), 95, 90, 110, 50,'child'); 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.