Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic What is the meaning of custom nodes in JavaScript? (Read 3142 times)
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
What is the meaning of custom nodes in JavaScript?
Sep 22nd, 2016 at 2:23pm
Print Post  
Hi,

It is pretty unclear when using web controls and you want to have custom node, should you copy same logic from .net class to JS prototype?
If so, why even use Web-controls for that when you can isolate logic at client side?? and avoiding duplicate models...
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3146
Joined: Oct 19th, 2005
Re: What is the meaning of custom nodes in JavaScript?
Reply #1 - Sep 22nd, 2016 at 2:58pm
Print Post  
Hi,

You don't need any logic in the .NET class, but only custom fields and serialization code if you will be saving diagram files on server. If you are asking about overriding methods in .NET classes such as AllowModify, Draw, etc, these are only used in the desktop version of the control, which shares the same assembly (although Draw would also be used in ASP.NET if you were using ImageMap mode).

If you don't care about saving diagram on server or inspecting the diagram model from .NET code, you could use only the JavaScript part of the control, which we also provide as a separate library -
http://mindfusion.eu/javascript-diagram.html

Using the ASP.NET control still has some benefits, for example it includes import / export libraries not available in JavaScript version.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
Re: What is the meaning of custom nodes in JavaScript?
Reply #2 - Sep 23rd, 2016 at 3:48pm
Print Post  
Slavcho wrote on Sep 22nd, 2016 at 2:58pm:
Hi,

You don't need any logic in the .NET class, but only custom fields and serialization code if you will be saving diagram files on server. If you are asking about overriding methods in .NET classes such as AllowModify, Draw, etc, these are only used in the desktop version of the control, which shares the same assembly (although Draw would also be used in ASP.NET if you were using ImageMap mode).

If you don't care about saving diagram on server or inspecting the diagram model from .NET code, you could use only the JavaScript part of the control, which we also provide as a separate library -
http://mindfusion.eu/javascript-diagram.html

Using the ASP.NET control still has some benefits, for example it includes import / export libraries not available in JavaScript version.

Regards,
Slavcho
Mindfusion



Thanks for such quick response, i am not really sure about what libraries importing and exporting you are referring to...but it seems in principle it is quite unnecessary and redundant to use diagramming component as in web form, instead it is much flexible to have it on client side. I think it is still possible to serialize in js and upload it to server a custom model.



  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3146
Joined: Oct 19th, 2005
Re: What is the meaning of custom nodes in JavaScript?
Reply #3 - Sep 26th, 2016 at 8:56am
Print Post  
Quote:
i am not really sure about what libraries importing and exporting you are referring to...


I mean the classes from MindFusion.Diagramming.Import / Export namespaces - letting you export the diagram to PDF, SVG, etc, or import from OpenOffice Draw or MS Visio. They are only available in .NET at this time.

Quote:
but it seems in principle it is quite unnecessary and redundant to use diagramming component as in web form, instead it is much flexible to have it on client side. I think it is still possible to serialize in js and upload it to server a custom model.


That's true, and Microsoft sunsetted Web Forms from what I know, it won't be implemented in the new ASP.NET Core framework. In any case we'll be supporting it while we still have active customers for it - people have legacy Web Forms applications, don't know JavaScript, etc. You could use this from server-side code only if you don't need to implement custom drawing in Canvas mode or add custom properties that you want to access on client side.

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