Poll
Poll closed Question: How to get Origin Id
bars   pie
*** This poll has now closed ***


origin id    
  0 (0%)
shape node    
  0 (0%)




Total votes: 0
« Created by: honghuhuang on: Dec 27th, 2011 at 5:22am »
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to get Origin Id (Read 8452 times)
honghuhuang
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Oct 10th, 2011
How to get Origin Id
Dec 27th, 2011 at 5:22am
Print Post  
I have a problem and I did not know how to solve it. Who can help me?


The problem is: when I drag two shape nodes to the canvas and connect these two shape nodes , What I want is that when I double click the son shape node ,How can I get the parent shape node id?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to get Origin Id
Reply #1 - Dec 27th, 2011 at 7:03am
Print Post  
Hi,

You could check the incoming links collection of the double-clicked node, and then the origin of the first link:

Code
Select All
var node = e.getNode();
if (node.getIncomingLinks().size() > 0)
{
      var linkFromParent = node.getIncomingLinks().get(0);
      var parent = linkFromParent.getOrigin();
      // do something with origin
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint