External Drag handling


I looked through the forums here and think this may not be possible, but I’ll ask anyways.

I have an external table/grid and want to drag its items over the GoJS diagram and have the diagram template’s mouse events to be handled/called when the item moves over the groups within the diagram. (i do a lot of validation and highlighting while mouse drag over events are occurring which work great with internal diagram dragged/dropped objects).

Is this possible from external draggable sources?

It looks like the GoJS dragging tool doesn’t get activated until the external mouse event has been completed…(in which case the mouse button is released and starting the drag afterwards via code is kind of non-intuitive).

Any ideas for workarounds would be much appreciated.

Doesn’t the HTML Drag-and-Drop sample, https://gojs.net/latest/samples/htmlDragDrop.html, do what you want?

It is more programming work than just using a Palette as the drag source, but I think you can do what you want. If that isn’t the case, we can discuss it.

That example does most, except the external drag doesn’t trigger the mouse event callbacks (enter,leave, dragenter, dragleave,drop etc) defined in the diagram & templates…which is what i am after. (to do all of the special interactive effects that I have in the diagram/templates such as: highlighting, pre-drop validation over groups, resizing and etc.)

Well, it is a bit of work, but you can call your internal side-effect methods from those mouse event handlers. The hard part, as shown in the sample, is getting the coordinates right.

EDIT: actually, Jon just mentioned to me that the new version of the HTML Drag Drop sample, https://gojs.net/latest/samples/htmlDragDrop.html, supports highlighting nodes it crosses over. Sorry for the confusion.