- Welcome, Guest. Please Login or Register
MindFusion  
  Diagram and Calendar controls for Xamarin have been released. Currently beta testing Diagram controls for Universal Windows Platform and Android v1.3  
  HomeHelpSearchLoginRegister   
     
     
   
 
Poll closed Poll
Question: How to get Origin Id
*** 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 Topic Print  
How to get Origin Id
Read 6273 times

honghuhuang   Offline
YaBB Newbies
*
Posts: 1
I love YaBB 1G - SP1!


   
     
 
How to get Origin Id
Dec 27th, 2011 at 5:22am
 
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?
 
 
 
IP Logged    
 
     

Stoyo   Offline
YaBB Moderator
*****
Posts: 13230
MindFusion support


   
     
 
Re: How to get Origin Id
Reply #1 - Dec 27th, 2011 at 7:03am
 
Hi,

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

Code:
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
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print