I have a column in my grid defined as:
This works fine, but when I add a column template like so:
I get the following error:
Uncaught Error: Invalid template:'<tr data-uid="#=data.uid#" role='row'><td role='gridcell'><div class="FieldValueLink" onclick="(function(e,obj){ /* do stuff */})(event, this)" >#=class#</div></td><td style="display:none" role='gridcell'>#:data.id==null?'':data.id#</td></tr>' Generated code:'var o,e=kendo.htmlEncode;with(data){o='<tr data-uid="'+(data.uid)+'" role=\'row\'><td role=\'gridcell\'><div class="FieldValueLink" onclick="(function(e,obj){ /* do stuff */ })(event, this)" >'+( class )+'</div></td><td style="display:none" role=\'gridcell\'>'+e(data.id==null?'':data.id)+'</td></tr>';}return o;' kendo.all.min.js:9
I'm sure this is because 'class' is a reserved word in javascript. Is there a different way to reference the field name in the template?
We're just trying to convert our existing grids to kendo grids. I'd rather not alter my database and all the existing code referencing this if it can be helped.
field :
"class"
title :
"Class"
width : 250
template :
"<div class=\\"FieldValueLink\\" onclick=\\"(function(e,obj){ /* do stuff */ })(event, this)\\" >#=class#</div>"
Uncaught Error: Invalid template:'<tr data-uid="#=data.uid#" role='row'><td role='gridcell'><div class="FieldValueLink" onclick="(function(e,obj){ /* do stuff */})(event, this)" >#=class#</div></td><td style="display:none" role='gridcell'>#:data.id==null?'':data.id#</td></tr>' Generated code:'var o,e=kendo.htmlEncode;with(data){o='<tr data-uid="'+(data.uid)+'" role=\'row\'><td role=\'gridcell\'><div class="FieldValueLink" onclick="(function(e,obj){ /* do stuff */ })(event, this)" >'+( class )+'</div></td><td style="display:none" role=\'gridcell\'>'+e(data.id==null?'':data.id)+'</td></tr>';}return o;' kendo.all.min.js:9
I'm sure this is because 'class' is a reserved word in javascript. Is there a different way to reference the field name in the template?
We're just trying to convert our existing grids to kendo grids. I'd rather not alter my database and all the existing code referencing this if it can be helped.