let's say my dataSource returns an id such as {id: 1}
and i'm using a template
columns: [ {field: "id", template: "<a href='javascript:;' id='#= id #' />#= id #</a>"} ...
how would I get it to show up as <a href="javascript:;" id="1">#1</a> as ##=id # won't work
1 Answer, 1 is accepted
0
Nikolay Rusev
Telerik team
answered on 26 Nov 2012, 07:56 AM
Hello Phil,
The '#' symbol in JavaScript is escaped with double backslash('\\'). All this is explained in the yellow box in the Templates Overview article. That said here is how the template should looks like:
"<a href='javascript:;' id='#= id #' />\\##= id #</a>"
//example
kendo.template( "<a href='javascript:;' id='#= id #' />\\##= id #</a>")({id: 1})
//will produce
"<a href='javascript:;' id='1' />#1</a>"
Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!