Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Container node caption not being set (Read 3377 times)
Al
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Sep 3rd, 2014
Container node caption not being set
Sep 4th, 2014 at 7:52am
Print Post  
Hi, I am creating a container like this:

Code (Javascript)
Select All
            var containerNode = diagram.getFactory().createContainerNode(bounds);
            containerNode.Caption = 'abc';
 



but the caption does not get set (btw the 'Caption' property is not documented, I found this in one of your online files)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Container node caption not being set
Reply #1 - Sep 4th, 2014 at 8:01am
Print Post  
Hi,

That looks like .NET code. In JavaScript version call the setText() method:

Code
Select All
containerNode.setText('abc'); 



Check the http://mindfusion.eu/demos/jsdiagram/Containers.html example for more sample code for setting up containers.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Al
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Sep 3rd, 2014
Re: Container node caption not being set
Reply #2 - Sep 4th, 2014 at 8:10am
Print Post  
That works, thank you. I am struggling a bit to find these methods because for eg. 'setText' doesn't appear for the 'ContainerNode' object in the help file.
  
Back to top
 
IP Logged
 
Al
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Sep 3rd, 2014
Re: Container node caption not being set
Reply #3 - Sep 4th, 2014 at 8:22am
Print Post  
One more thing - is it possible to centre the container caption?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Container node caption not being set
Reply #4 - Sep 4th, 2014 at 9:06am
Print Post  
Right, our help generation system does not understand JavaScript inheritance at this time and won't show inherited methods. You could look for base DiagramNode and DiagramItem methods here:

http://www.mindfusion.eu/onlinehelp/jsdiagram/index.htm?CC_T_MindFusion_Diagramm...
http://www.mindfusion.eu/onlinehelp/jsdiagram/index.htm?CC_T_MindFusion_Diagramm...

There's no official public method to specify alignment, buy you could set it through the Text object used to render the caption:

Code
Select All
var cn = diagram.getFactory().createContainerNode(50, 50, 50, 50);
cn.setText("caption");
cn.text.textAlignment = Alignment.Center; 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Al
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Sep 3rd, 2014
Re: Container node caption not being set
Reply #5 - Sep 4th, 2014 at 11:26am
Print Post  
Sorted, thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint