Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

ExternalObjectsDropped subject got empty count 0

$
0
0

@BATU wrote:

this is a very tricky behavior puzzled me two days.
ExternalObjectsDropped event, the subject got empty or count is 0.
because I need to identify diagram objects, add diagramKey property to the diagram.

diagramA.diagramKey = “MxPSYQYxLwJvtifq9TldiNNNNNNNNNNNNNNNNN”;
function ExternalObjectsDropped(e) {
e.subject.each(function (node) {
console.log(">>Node<<");
});
console.log(">>ExternalObjectsDropped<<");
}

diagramA.addDiagramListener(“ExternalObjectsDropped”, ExternalObjectsDropped);

// change key and load new json
$("#bbb").click(function(){
diagramA.diagramKey = “MxPSYQYxLwJvtifq9Tld/iXHvOYB7dYQ0iZ44smiNNNNNNNNNNNNNNNNN/sssdfasdf”;
diagramB.model = go.Model.fromJson(diagramJSON);
});

after load new JSON e.subject.count == 0 and don’t enter the loop.
it is shape dropped success, but e.subject got empty! ,
if you write simple code with 2 diagrams to test this not occur. my real code is too big not convenient to paste here.

then I add this code to my script, everything work fine.

var div = diagramA.div;
diagramA.div = null;
diagramA.div = div;

any suggestions?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles