Hi Walter,
Thanks for the reply. But I am not sure how to iterate over e.Subject.
I want to bind this function to each palette parts. Basically, My palette having different parts/images (for example, Desktop, Laptop) when user drags Desktop I want to show popup windows which will show Desktop related property, Same for Laptop, If user select Laptop, popup will show laptop property.
Below is my Node. I want to add custom attribute and want to fetch its value at above event. Below is my try, but it is not working
Desktoptemplate =go$(go.Node, “Spot”, nodeStyle(),
new go.Binding(“location”, “loc”, go.Point.parse).makeTwoWay(go.Point.stringify),
<span =“Apple-tab-span” style=“white-space:pre”> new go.Binding(“EqipId”,“Id”,“1”),
go$(go.Panel, “Auto”,
go$(go.Shape, “Rectangle”,
{ fill: mainColor, stroke: null },
new go.Binding(“figure”, “figure”)),
go$(go.Picture, { source: replaceImage, name: “pic”,
width: 80, height: 55, imageStretch: go.GraphObject.Fill
})
));
divFloor.nodeTemplateMap.add(“Desktop”, Desktoptemplate );<span =“Apple-tab-span” style=“white-space:pre”> //Same template for Laptop.
divFloor.addDiagramListener(“ExternalObjectsDropped”, function (e) {
alert(e.subject);
var data = divFloor.model.nodeDataArray[0]; // get the first node data
var node = divFloor.findNodeForData(data); // find the corresponding Node
var p = node.EqipId;
alert§;
});
Output: Undefined.
Note: Yes Agree, that multiple parts can be dragged from palatte.