UndoManager working principle about


#1

UndoManager does not save data changes that are not caused by a visual change ?
Changeset values have only visual changes.
I see this on source:
this.diagram.undoManager.history.each((transaction) => {
transaction.changes.each((change) => {
console.log(change);
});
});


#2

What other kinds of changes are you referring to? Are they happening within a transaction?

You may be interested in the Update Demo sample.


#3

I have a node data interface.
node.data:{
nodeConfig:{},
properties:{},
events:{},
…,
[any field name but not used visually]
}
All of the visual settings are within “nodeConfig”.
Undo manager is true working when i change any field in “nodeConfig”.
But not working when i change any field in “properties” or “any field but not used visually”


#4

How are you updating your data? You need to call Model.set when updating properties if you wish for them to be recorded.


#5

i tried “Model.set” method but is not working.
Let me also specify i always change node.data reference when use model.set or model.setDataProperty.
Is this a problem ?


#6

Take a look at this codepen, and try hitting the Update Data button, then the Log Undo History button.

I find that if I open the console, the change is recorded.


#7

So thanks jhardy