How to get function on Ctrl-- on a node?
Default is zoom decrease. But After selecting a node when press Ctrl-- it should rotate the node to an angle( Like: 90º)
How to get function on Ctrl-- on a node?
Default is zoom decrease. But After selecting a node when press Ctrl-- it should rotate the node to an angle( Like: 90º)
Override CommandHandler.doKeyDown to catch that particular situation and do what you want, and otherwise call the super method.
Please read GoJS Commands -- Northwoods Software for more discussion and an example.
My code is
var tool = myDiagram.commandHandler;
tool.decreaseZoom = function(e) {
//console.log(“decreaseZoom”);
var diagram_data = [];
diagram_data = myDiagram.selection.toArray();
//console.log(diagram_data[0].data);
if (diagram_data.length > 0) {
myDiagram.commandHandler.rotate(-90);
}
};
I want zoom when not select any node.
It is not working.
Is there a reason you are overriding CommandHandler.decreaseZoom, instead of overriding CommandHandler.doKeyDown as I suggested to meet your stated requirements?
To find out if there are any Parts selected, just check myDiagram.selection.count > 0
.
I need two function
How to find Keypad-- OR Keypad-+ is pressed?
Done.
Thanks a lot.