How to pass an additional parameter to a kendo template with the datasource parameter disabled

I have this dojo :

I am trying to pass an extra parameter to a template with:

detailTemplate: kendo.template($("#detail-template").html())({someParam: 'someValue'}) 

However, when I do this, I can no longer use the variables coming from the data source. When I uncomment these variables, it gives an error (see console output)

  <div> Name: #: /*name*/ # </div> <div> Age: #: /*age*/ # </div> 

How to use datasource variables and an external variable in a kendo template?

+5
source share
1 answer
 detailTemplate: function(dataItem){ dataItem.someParam = 'someValue'; return kendo.template($("#detailTemplate").html())(dataItem); } 

dojo: http://dojo.telerik.com/OvASO

+6
source

Source: https://habr.com/ru/post/1238758/


All Articles