1

When a user load the draw.io on my site, I want to know when he does any change on it. My goal is to disable the save button as long there are no changes. I could set a property at mxEvent.CELLS_ADDED, mxEvent.CELLS_REMOVED, mxEvent.CELLS_RESIZED, mxEvent.CELLS_MOVED. But is there a single one event to catch for it?

may be catching a event like:

Graph.prototype.addListener( mxEvent.CELLS_CHANGED,...

How I get a event when the user dos changes?

Thanks, Frank

Frank Mehlhop
  • 1,480
  • 4
  • 25
  • 48

1 Answers1

1
Graph.prototype.addListener(
    'DrawIOLoaded',
    mxUtils.bind(this, function() {
        drawIoUi.editor.graph.getModel().addListener(
            mxEvent.CHANGE,
            mxUtils.bind(drawIoUi, function(sender, evt) {
                // content was changed !!!
            })
        );
    })
);
E_net4
  • 27,810
  • 13
  • 101
  • 139
Frank Mehlhop
  • 1,480
  • 4
  • 25
  • 48