@JP wrote:
In this sample http://gojs.net/latest/samples/draggableLink.html, If any modification occurs then it will detect in this listener myDiagram.addDiagramListener("Modified", function(e) {..});
So, I have added diagram default to readOnly Property by assigning
myDiagram.isReadOnly = true;and also added one check box for enabling and disabling the readOnly property.
and Added following lines in Modified Listener
console.log(e.diagram.commandHandler.canUndo()) console.log(e.diagram.commandHandler.canRedo())Here is the issue,
1. Default diagram will be read only
2. Clicked on check box to make diagram editable
3. Did some modification in diagram and then in console it prints from Modified Listener
true
false
4. I tried Undo and it prints
false
false // Here actually I expected true due to redo operation but returns false
5. I tried Redo and prints
true
false
6. After that I tried undo and redo but it's not detecting in console.Can I the why this behaviour happens? I understand that due to read-only property this is behaving like this. How to get the behaviour as expected
1. After Modify -> true, false
2. After Undo -> false, true
3. After Redo -> true, false
4. After Undo -> false, true
and so...
Posts: 1
Participants: 1