case study is as below:
######################################################################################################
<table id="grid" >
<thead>
<tr>
<th style="width:90px;" data-field="fc_saledate">SaleDate</th>
<th style="width:100px;" data-field="fc_price">Price</th>
<th style="width:80px;" data-field="fc_perval">%ofVal</th>
</tr>
</thead><tbody></tbody>
</table>
<script id="rowTemplate" type="text/x-kendo-tmpl">
<tr id="list_${fc_pid}">
<td style="width:90px;" >${ fc_saledate }</td>
<td style="width:100px; text-align:right" >${ fc_price }</td>
<td style="width:80px; text-align:right" >${ fc_perval }</td>
</tr>
</script>
$("#grid").kendoGrid({
rowTemplate: kendo.template($("#rowTemplate").html()),
columns: [
{
field: "fc_saledate",
title: "SaleDate",
template: '#= kendo.toString(SaleDate,"dd MMMM yyyy") #'
},
{
field: "fc_price",
title: "Price",
format: "integer"
},
{
field: "fc_perval",
title: "%ofVal"
}
],
dataSource: {data: app_list.get_list_content()},
height: 350,
scrollable: true,
sortable: true,
pageable: false,
dataBound: function(e){ app_filter.hide_ids_on_sort(app_filter.hidden_ids_for_kendo_sort);}
});
######################################################################################################
The result table looks like this
SaleDate Price %ofVal
Feb - 20 $50,000 25%
Feb - 23 $90,000 5%
Feb - 24 $60,000 2.5%
Feb - 25 $10,000 50%
Feb - 28 $1,100,000 50%
On sorting these columns specially 'Price' and '%ofVal' they don't sort good. looks like it is sorting as string and sort only by first digit not by number as whole.
Where do i specify the sorting type like integer/string/date/decimal etc to force it sort according to this formates? Also please give the list of all sorting format type.
Thanks!
######################################################################################################
<table id="grid" >
<thead>
<tr>
<th style="width:90px;" data-field="fc_saledate">SaleDate</th>
<th style="width:100px;" data-field="fc_price">Price</th>
<th style="width:80px;" data-field="fc_perval">%ofVal</th>
</tr>
</thead><tbody></tbody>
</table>
<script id="rowTemplate" type="text/x-kendo-tmpl">
<tr id="list_${fc_pid}">
<td style="width:90px;" >${ fc_saledate }</td>
<td style="width:100px; text-align:right" >${ fc_price }</td>
<td style="width:80px; text-align:right" >${ fc_perval }</td>
</tr>
</script>
$("#grid").kendoGrid({
rowTemplate: kendo.template($("#rowTemplate").html()),
columns: [
{
field: "fc_saledate",
title: "SaleDate",
template: '#= kendo.toString(SaleDate,"dd MMMM yyyy") #'
},
{
field: "fc_price",
title: "Price",
format: "integer"
},
{
field: "fc_perval",
title: "%ofVal"
}
],
dataSource: {data: app_list.get_list_content()},
height: 350,
scrollable: true,
sortable: true,
pageable: false,
dataBound: function(e){ app_filter.hide_ids_on_sort(app_filter.hidden_ids_for_kendo_sort);}
});
######################################################################################################
The result table looks like this
SaleDate Price %ofVal
Feb - 20 $50,000 25%
Feb - 23 $90,000 5%
Feb - 24 $60,000 2.5%
Feb - 25 $10,000 50%
Feb - 28 $1,100,000 50%
On sorting these columns specially 'Price' and '%ofVal' they don't sort good. looks like it is sorting as string and sort only by first digit not by number as whole.
Where do i specify the sorting type like integer/string/date/decimal etc to force it sort according to this formates? Also please give the list of all sorting format type.
Thanks!