BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Neil
We have analyzed your requirement for performing sorting
operation in the customTemplate column. As per the behavior, we should not
perform filtering, sorting, editing and grouping in Unbound columns. To perform
such operations the column must be bound to the grid datasource.
Also the sorting operation is performed based on the field property of the column.
So if you want to perform sorting to the customTemplate column based on the
Name property, please refer the below code snippet.
<script type="text/x-jsrender" id="columnTemplate">
{{if Color && Color.Name}}
<div style="height:20px;background-color: {{:Color.Hex }};"></div>
{{:Color.Name}}
{{/if}} </script> <script> $("#Grid").ejGrid({ columns:
[
{ field: "Color.Name", headerText: 'Template
Column', textAlign: ej.textAlign.Left, width:
100,columnTemplate: true, templateId: "#columnTemplate"}, . . .] . . . </script> |
For your convenience, we have created a simple sample for
performing sorting operation on customTemplate column. The sample can be downloaded
from the attachment.
Please let us know if you need any further assistance.
Regards
Ragavee U S