Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic default node (Read 2555 times)
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
default node
May 13th, 2019 at 6:17am
Print Post  
Hi, Can I load page with a default node lready created into the same canvas?
  
Back to top
AIM  
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: default node
Reply #1 - May 13th, 2019 at 7:56am
Print Post  
Hi,

Call view.Diagram.Factory.CreateShapeNode before sending the DiagramView to client side. Alternatively call equivalent JavaScript code from ControlLoadedScript handler if you detect the diagram is empty.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: default node
Reply #2 - May 13th, 2019 at 10:33am
Print Post  
Thanks, but the thing we we need in our appliaction is that, we are having multiple worktypes. whenever user click on a particular worktype, it will render to the page to create flowchart for which we are using Mindfusion. Now I want that whenever this page will get opened then a default circular node will be there having different color and text of the selected worktype(by default and will not connected to anyother nodes that means we do not want to link it to the other nodes later which will be created by the user). Please help me to achieve this.
  
Back to top
AIM  
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: default node
Reply #3 - May 13th, 2019 at 11:41am
Print Post  
Try 'new workflow type' handler like this if implementing on client side -

Code
Select All
diagram.clearAll();

var root = diagram.getFactory().createShapeNode(defaultRect);
root.setShape("Ellipse");
root.setBrush("red");
root.setText("workflow type");
root.setLocked(true); // prevent drawing links
 



Instead of setting Locked, you could disable the AllowOutgoingLinks and AllowIncomingLinks properties to still allow selecting and moving the root node.
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: default node
Reply #4 - May 14th, 2019 at 3:46am
Print Post  
It worked. Thanks. but this thing loads under my other canvas which is used to draw diagram. I want this to be happen on the same @Html.Diagram view canvas which is using to draw the diagram.Please help
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: default node
Reply #5 - May 14th, 2019 at 6:26am
Print Post  
Hi,

By other canvas what exactly do you mean? If you're using more than one DiagramView instance on the page, you can identify it by its id. If you just mean server-side, you can refer to the code examples here https://www.mindfusion.eu/onlinehelp/mvcdiagram/index.htm?CC_Tutorial_1__Getting... for creating items in the code-behind.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint