Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with getNodes Method (Read 4729 times)
anu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Location: Bhopal
Joined: Jan 27th, 2012
Problem with getNodes Method
Oct 25th, 2012 at 9:53am
Print Post  
I want to find a node by text by getting array of all DiagramNode in NodeListView. I have written a function for it
Code (Javascript)
Select All
function findNodeByText(searchString)
{
	if(searchString==null)
		return null;

	var diagramNode=diagram.getNodes();
	for(var i=0; i<diagramNode.length; i++){
		var dnode=diagramNode[i];
		if (searchString==dnode.getText)
			return dnode;
		return null;
	}
}
 



but this function is not working .How should i use getNodes() method.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with getNodes Method
Reply #1 - Oct 25th, 2012 at 10:10am
Print Post  
You are comparing string to a function instead to the result of a function call, try adding parentheses after getText.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
anu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Location: Bhopal
Joined: Jan 27th, 2012
Re: Problem with getNodes Method
Reply #2 - Oct 25th, 2012 at 10:30am
Print Post  
Yes it should be getText();

but when i m trying to print length of the array return by diagram.getNodes() using the following statement it shows nothing.

alert(diagramNode.length);

It means i m wrong near by diagram.getNodes() statement. How can i do this?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with getNodes Method
Reply #3 - Oct 25th, 2012 at 4:05pm
Print Post  
Try that with var diagramNodes = diagram.nodes;

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
anu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Location: Bhopal
Joined: Jan 27th, 2012
Re: Problem with getNodes Method
Reply #4 - Oct 26th, 2012 at 10:35am
Print Post  
Thanks its working i want to one more thing Is OrthogonalLayout is not available in current version ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with getNodes Method
Reply #5 - Oct 26th, 2012 at 1:01pm
Print Post  
Hi,

OrthogonalLayout is not available yet in the JavaScript library. The following layout classes have been ported so far: SpringLayout, TreeLayout, LayeredLayout and FractalLayout.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
anu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Location: Bhopal
Joined: Jan 27th, 2012
Re: Problem with getNodes Method
Reply #6 - Oct 27th, 2012 at 9:19am
Print Post  
Hi,
    Thanks so which layout can be replacement for OrthogonalLayout.Actually i have to set layout for process flow diagram.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with getNodes Method
Reply #7 - Oct 29th, 2012 at 6:55am
Print Post  
Hi,

Try LayeredLayout.

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