I have a grid bound to a data source that could have 20 columns with the same data type. I would like them all to be formatted the same way. Can you use a generic column template that could be apply separately to each field?
I would like to be able to do something like:
...
columns
[
{ field: 'Field1', columnTemplate: true, templateId: "#fieldTemplate" }
{ field: 'Field2', columnTemplate: true, templateId: "#fieldTemplate" }
{ field: 'Field3', columnTemplate: true, templateId: "#fieldTemplate" }
]
...
and then in the template, reference the field, something like:
<script type="text/x-jsrender" id="fieldTemplate">
<img src="images/{{:WHAT DO I PUT HERE?}}.png" />
</script>
I do not have to repeat this script block for each different field, do I?
I found this post (http://www.syncfusion.com/forums/116069/example-documentation-on-how-to-use-a-column-template) but the suggested solution will not work for me because I need the fields to be in individual columns.
Thanks