We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to perform Template binding for node with serialization support?

You can embed the SVG, HTML element into node using templateId property and the embedded SVG, HTML elements can be bounded with node’s properties using JSRender templates.

Native Node

Diagram supports to embed SVG element into node. It is achieved by setting node shape’s type as ej.datavisualization.Diagram.Shapes.Native and assigns the template id to the shape’s templateId property.

C:\Users\ApoorvahR\Desktop\Note.pngNote:

  1. Refer to the “jsrender.min.js” file for template binding support.
  2. Template (HTML/ SVG tags) have to be retained in application side as only its ID is saved during Diagram’s save method.
  3. SVG or HTML element defined in script tag cannot be displayed in the browser.

The following code illustrates how a Native node is created.

JS

CSHTML

Controller

ASPX

ASPX.CS

 

Figure 1: Native Shape

HTML Node

You can embed the HTML elements in Diagram through HTML shape node. It is achieved by setting node shape’s type as ej.datavisualization.Diagram.Shapes.Html and assigns the template id to the shape’s templateId property. The following code illustrates how an HTML node is created.

JS

CSHTML

Controller

ASPX

ASPX.CS

 

http://help.syncfusion.com/ug/js/ImagesExt/image65_10.png

Figure 2: HTML Shape

Article ID: Published Date: Last Revised Date: Platform: Control:
3122 01/09/2015 01/09/2015 ASP.NET MVC Diagram
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.