Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) NodeListView to display vertically (Read 5381 times)
RJ
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 27
Joined: Sep 4th, 2015
NodeListView to display vertically
Sep 4th, 2015 at 3:14pm
Print Post  
Is there a way to make the nodes in the NodeListView to appear side by side(vertically) instead of horizontal?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView to display vertically
Reply #1 - Sep 4th, 2015 at 4:33pm
Print Post  
NodeListView does not support horizontal orientation at this time, we'll try to add a property in next few days.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView to display vertically
Reply #2 - Sep 10th, 2015 at 11:14am
Print Post  
This version adds NodeListView.Orientation property:
https://mindfusion.eu/_beta/jsdiag_241.zip

At this time it works only before adding nodes to the view:

Code
Select All
var Orientation = MindFusion.Diagramming.Orientation;
nodeList.setOrientation(Orientation.Horizontal);
nodeList.addNode(...); 




New version also has some classes moved to common.js, which you must load before diagramming.js:

Code
Select All
<script src="MindFusion.Common.js" type="text/javascript"></script>
<script src="MindFusion.Diagramming.js" type="text/javascript"></script> 



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


I Love MindFusion!

Posts: 27
Joined: Sep 4th, 2015
Re: NodeListView to display vertically
Reply #3 - Sep 11th, 2015 at 4:20pm
Print Post  
Thanks Stoyan. It works great now Smiley. One more question is it possible to lay out the node in a table format(3 per row)?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView to display vertically
Reply #4 - Sep 14th, 2015 at 8:32am
Print Post  
It's not possible out of the box. Perhaps you could create a separate NodeListView for each row if you won't need scrolling in that format?
  
Back to top
 
IP Logged
 
RJ
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 27
Joined: Sep 4th, 2015
Re: NodeListView to display vertically
Reply #5 - Sep 16th, 2015 at 2:16pm
Print Post  
I'll give it a try. Thanks again for your time.

Another question - how can i create a custom node without a bounding rectangle. I want just the image and a text below it?

Thanks,
Raji
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView to display vertically
Reply #6 - Sep 16th, 2015 at 6:07pm
Print Post  
You could enable ShapeNode.Transparent property to hide the node's geometry, leaving only image and text visible. Either set ImageAlign and LineAlignment properties to place image at top and text at bottom, or set their positions as shown in this post:
http://mindfusion.eu/Forum/YaBB.pl?num=1439580359/1#1

If you prefer using a custom node type, follow tutorial 3 but render a single text field with appropriate cooridnates, again setting Transparent of base ShapeNode class to hide bounding rectangle.

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


I Love MindFusion!

Posts: 27
Joined: Sep 4th, 2015
Re: NodeListView to display vertically
Reply #7 - Sep 17th, 2015 at 4:43pm
Print Post  
Thanks Stoyan. That did the trick. One question on the Orientation. When i change the orientation to Horizontal, how do i increase the spacing between the node. SetPadding doesnt seem to work.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView to display vertically
Reply #8 - Sep 18th, 2015 at 12:56pm
Print Post  
setPadding works for me, but it too should be called before addNode methods. We'll try to fix property setters for official release to invalidate NodeListView layout, so you'll be able to change properties even after the list is populated. If at this time you need to let users change such settings at runtime, you will need to rebuild the list by calling NodeListView.clearAll and then adding the nodes again.

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


I Love MindFusion!

Posts: 27
Joined: Sep 4th, 2015
Re: NodeListView to display vertically
Reply #9 - Sep 18th, 2015 at 4:18pm
Print Post  
Stoyan,
Thanks for your help. I am trying to implement Tutorial 4 sample inside dojo , but keep getting this error when i do the paste operation and paste does not work.
Uncaught ReferenceError: OrgChartNode is not defined

I have attached the code with this email. Can you please help me with this.

Thanks,
Raji
  

Code_001.zip ( 8 KB | 138 Downloads )
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView to display vertically
Reply #10 - Sep 21st, 2015 at 7:54am
Print Post  
I could not get this to run, but I think the problem in code from txt file is that the OrgChartNode constructor function is defined locally inside your ready handler, while it should be accessible in global context by same name you pass to RegisterClass. That name is saved as class identifier in clipboard's Json data, and when pasting later the diagram will try to instantiate nodes by finding that constructor by name and calling it.

So try moving the OrgChartNode definition outside the "ready" handler. If you don't want to define classes in global context, you could create a namespace object and add them to it, then register the class by specifying namespace too, e.g. "mycompany.OrgChartNode".

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


I Love MindFusion!

Posts: 27
Joined: Sep 4th, 2015
Re: NodeListView to display vertically
Reply #11 - Sep 21st, 2015 at 1:31pm
Print Post  
Thanks Stoyan. That really helped. I moved the definition outside and it started to work!

Thanks,
Raji
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint