Search code examples
kendo-uidojotelerikkendo-template

How to pass additional parameter to kendo template with out overriding datasource parameter


I have this dojo:

I am trying to pass additional parameter to template via:

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

However when I do this, I can't no more use variables coming from data source. When I uncomment those variables it gives error(see console output)

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

How can I use both datasource variables and external variable in kendo template?


Solution

  • detailTemplate: function(dataItem){ 
        dataItem.someParam = 'someValue';
        return kendo.template($("#detailTemplate").html())(dataItem);
    }
    

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