- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.JavaScript pack. It includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are more details and live demo for anyone interested.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
How do I load xml into ContainerNode??
Read 1608 times

JH.Chen   Offline
YaBB Newbies
*
Posts: 6
I Love MindFusion!


   
     
 
How do I load xml into ContainerNode??
Mar 17th, 2017 at 4:57am
 
I created a new diagram,and load xml into this diagram.

Then I add items from new diagram into my mainDiagram one by one.

But if new diagram has group, and node in mainDiagram, the MasterGroup will be gone(null).

It will be ungroup.

So how can I do ????????
Please tall me~~
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1746
Gender: male
tech.support


   
     
 
Re: How do I load xml into ContainerNode??
Reply #1 - Mar 17th, 2017 at 7:39am
 
If you are calling node's copy constructor and adding the copy to main diagram, that won't automatically copy group object and child nodes. You could copy the child nodes separately in a loop and attach them again to master copy. If doing that on server side, you could select all items from the group and call CopySelection and PasteSelection methods with copyGroups argument set to true.
 
 
 
IP Logged    
 
     

JH.Chen   Offline
YaBB Newbies
*
Posts: 6
I Love MindFusion!


   
     
 
Re: How do I load xml into ContainerNode??
Reply #2 - Mar 17th, 2017 at 11:26am
 
Thanks you,Slavcho.

I'll try this way.

If it works, I'll tall you. Smiley

 
 
 
IP Logged    
 
     

JH.Chen   Offline
YaBB Newbies
*
Posts: 6
I Love MindFusion!


   
     
 
Re: How do I load xml into ContainerNode??
Reply #3 - Mar 22nd, 2017 at 1:50am
 
Slavcho wrote on Mar 17th, 2017 at 7:39am:
If you are calling node's copy constructor and adding the copy to main diagram, that won't automatically copy group object and child nodes. You could copy the child nodes separately in a loop and attach them again to master copy. If doing that on server side, you could select all items from the group and call CopySelection and PasteSelection methods with copyGroups argument set to true.


Hi,Slavcho.
Do this way can copy customize object (nodes,links etc.) ??
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1746
Gender: male
tech.support


   
     
 
Re: How do I load xml into ContainerNode??
Reply #4 - Mar 22nd, 2017 at 7:33am
 
Do you mean copying your own properties for custom item classes? Diagram.CopySelection calls items' Clone method, and default Clone implementation calls copy constructor of the class. So for custom properties support you must either add a copy constructor or override Clone method in the derived class.

Regards,
Slavcho
 
 
 
IP Logged    
 
     

JH.Chen   Offline
YaBB Newbies
*
Posts: 6
I Love MindFusion!


   
     
 
Re: How do I load xml into ContainerNode??
Reply #5 - Mar 22nd, 2017 at 7:38am
 
Thank you,Slavcho.

I got it.
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print