This is a migrated thread and some comments may be shown as answers.

SVG is not rendering with kendo templates in Firefox and IE

1 Answer 204 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Siva
Top achievements
Rank 1
Siva asked on 29 May 2014, 11:48 AM
Hi All,

I want to build svg paths with kendo templates binding with MVVM view model. See this http://jsfiddle.net/qqzmZ/9/. I am also attaching following images which are rendered in chrome and firefox.

Known Issue:
In firefox, when we inspect svg element and edit that svg tag element
(right click and select "Edit Svg") then the svg is rendering.

But in IE 10, no path tags are found in svg tag.

Could you please give me the solution?

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 02 Jun 2014, 07:04 AM
Hello,

Currently, the Kendo templates will be evaluated and appended to the DOM using innerHTML. This won't work reliably for SVG with the exception of Chrome which seems to handle it well.
Other browser require the elements to be created with the correct namespace. Since the template output is a string this typically involves a DOMParser.
The code works out to something like this:

var parser = new DOMParser();
var doc = parser.parseFromString(svgString, "text/xml");
var node = document.adoptNode(doc.documentElement);
// node can now be appended to the current document


The bad news is that there's currently no way to extend the template rendering to use this code.
Please, file a request over at our UserVoice portal for SVG support so other users can vote for it.

Apologies for the caused inconvenience.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Templates
Asked by
Siva
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or