Hi there, i’m trying to drag different type of links from a jquery palette onto gojs diagram, much like this example: http://www.gojs.net/latest/samples/jQueryDragDrop.html, but i need different type of links
my attempt was to add data to the jquery object, like so
$(".palette-links").draggable().data("type", "link");
then, following the example, instead where
var model = myDiagram.model;
model.startTransaction("drop");
model.addNodeData({
text: text,
loc: go.Point.stringify(q)
});
model.commitTransaction("drop");
i’ll do something like
var model = myDiagram.model;
model.startTransaction("drop");
if ((ui.draggable).data("type") === 'link') {
model.addLinkData();
} else {
model.addNodeData({
text: text,
loc: go.Point.stringify(q)
});
};
model.commitTransaction("drop");
i feel this approach is rather simple, and i am struggling to show the link on to the canvas, although i did add a basic linkTemplate to myDiagram.