Display content as html in a grid column row

1 Answer 210 Views
Grid
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Morten asked on 22 Sep 2022, 03:43 PM

I get content as HTML encoded and would like to render this content as HTML in a grid row column using a template.

template: window.kendo.template($("#title").html())

<script id="title" type="text/x-kendo-template">
  <strong>#:title#</strong>
  <div>#:content#</div>
</script>

Have tried many (all) combinations of #:content#, #=content#, encoded: false, kendo.htmlEncode...

Please see the screenshot.

What am I doing wrong?

/Morten

 

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 27 Sep 2022, 09:18 AM | edited on 27 Sep 2022, 09:18 AM

Hello Morten,

I assembled a small Dojo demo where a template is used for a column rendering of the values. Please take a look at it:

Furthermore, you can see all available properties that can be displayed by logging them in the console:

 

<script id="title" type="text/x-kendo-template">
  	<strong>#= ProductID#</strong>
        <strong>#= console.log(data) #</strong>
</script>

 

I hope this helps!

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Nikolay
Telerik team
Share this question
or