Once a model is saved , the mxModel xml is saved in Database. So when the user wants to edit that model, I retrieve the model and decode it using the following code
var xmlDocument = mxUtils.parseXml(mxModel);
var decoder = new mxCodec(xmlDocument);
var node = xmlDocument.documentElement;
decoder.decode(node, graph.getModel());
let elt = xmlDocument.documentElement.firstChild;
Beyond this, I have options in the graph to edit the graph further. Like Add,Copy, Delete etc . All the Add Operations are working fine, but the Operations which is are trying to remove cells its not getting reflected in the graph realtime.
So for example for Delete operation, I have the following code bounded under beginUpdate() and endupdate()
graph.getModel().beginUpdate();
graph.removeCellsFromParent([selectedCell]);
graph.getModel().remove(e[0]);
graph.getModel().remove(selectedCell);
graph.getModel().endUpdate();
With this operation, the delete is happening but its not reflected in the screen. I have arrived to this conclusion because when I save the Model and reload it, the deleted cell is no longer there.
Once a model is saved , the mxModel xml is saved in Database. So when the user wants to edit that model, I retrieve the model and decode it using the following code
var xmlDocument = mxUtils.parseXml(mxModel); var decoder = new mxCodec(xmlDocument);
var node = xmlDocument.documentElement; decoder.decode(node, graph.getModel()); let elt = xmlDocument.documentElement.firstChild; Beyond this, I have options in the graph to edit the graph further. Like Add,Copy, Delete etc . All the Add Operations are working fine, but the Operations which is are trying to remove cells its not getting reflected in the graph realtime.
So for example for Delete operation, I have the following code bounded under beginUpdate() and endupdate()
graph.getModel().beginUpdate(); graph.removeCellsFromParent([selectedCell]); graph.getModel().remove(e[0]); graph.getModel().remove(selectedCell); graph.getModel().endUpdate(); With this operation, the delete is happening but its not reflected in the screen. I have arrived to this conclusion because when I save the Model and reload it, the deleted cell is no longer there.
I need to show the delete in real time.