How to pass additional parameter to kendo template with out overriding datasource parameter
Asked Answered
O

1

9

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?

Oblong answered 20/12, 2015 at 11:58 Comment(0)
C
11
detailTemplate: function(dataItem){ 
    dataItem.someParam = 'someValue';
    return kendo.template($("#detailTemplate").html())(dataItem);
}

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

Croatian answered 20/12, 2015 at 13:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.