MJ
1
Hello,
When I drag, I want the node to be selected without the diagram moving.
I applied the code below but it does not work.
this.myDiagram.toolManager.draggingTool.isEnabled = false;
this.myDiagram.toolManager.dragSelectingTool.isEnabled = true;
How can I fix it?
Thanks,
Mun
walter
2
I think you want to disable the PanningTool.
this.myDiagram.toolManager.panningTool.isEnabled = false;
MJ
4
And one more question,
Can I make only nodes selected when dragging with dragSelectingTool? (except linkā¦)
walter
5
Do you need to allow Links to be selected at all? If not, just set selectable to false on each Link template.
Otherwise it might be easiest to override DragSelectingTool.selectInRect to call the base method and then deselect all selected Links.
MJ
6
I tried to override DragSelectingTool.selectInRect as your advice.
var tool = this.myDiagram.toolManager.dragSelectingTool;
tool.selectInRect = function(){
//call base method
go.DragSelectingTool.prototype.selectInRect.call(tool);
//TODO : deselect link
}
But I got a console error when dragged

Am I misusing it?
walter
7
Yes, you are, because it takes one argument: DragSelectingTool | GoJS API
MJ
8
oh i missed it. Thank you