I recently started using Kendo-UI in my project and wanted to have a column in my grid display an image button along with a field, similar to the 'Contact Name' column in the documentation here. After exploring the documentation, I came across the following code snippet.
columns: [{
template: "<div class='customer-photo'" +
"style='background-image: url(../content/web/Customers/#:data.CustomerID#.jpg);'></div>" +
"<div class='customer-name'>#: ContactName #</div>",
field: "ContactName",
title: "Contact Name",
width: 240
}, {
field: "ContactTitle",
title: "Contact Title"
}, {
field: "CompanyName",
title: "Company Name"
}, {
field: "Country",
width: 150
}]
I realized that directly writing HTML in the template might not be the best approach, especially for complex templates. So, I found an alternative solution in the documentation.
"template": "kendo.template($('comments-template').html())"
In my scenario, this seems like a more practical solution. However, I am unsure about where it would be better to define the template. I also utilize AngularJS. Should I create a new file specifically for the template or is there a better place to define it?
Thank you