value is ReinsDepositAmount
**
output
**
I have recently stocked with one of the application date sorting in the kendo UI grid.
In kendo grid, the column name is defined like this
Incoming value to ReinsDepositDate
- Month,date,year format. 08-23-1991
Field name is ReinsDepositDate:
{
field: "ReinsDepositDate", type: "date", title: "Due Date",format: "{0:M/d/yyyy}", width: 100, filterable: {
cell: {
operator: "contains"
}
}
},
When Sorting the date, its sorting based on first values
- 1/12/1994
- 23/1/2015
- 13/1/1992
means while ascending I am getting
- 1/12/1994
- 13/1/1992
- 23/1/2015
So I have put the schema model
still, I am getting the same result.
schema: {
model: {
fields: {
ReinsDepositDate: { type: "date",format: "{0:dd/MM/yyyy}"}
}
}
},
I have seen lots of fiddle demos nothing works here why:
Refrences: http://fiddle.jshell.net/NqrDS/light/ Kendo grid date column not formatting
Flow of Design:
Flow of design is by using angular Http service get the value from DB through API and assign the response to datasource in the kendo grid. when I doing a demo with JSON files, its working fine. But the same thing applies it here means not working. so I went to custom javascript to sort. columns:[$scope.grdPrmiumDepositCol, –
Custom javascript in kendo sortable attribute will do the trick. working fine do this part.
{ field: "ReinsDepositDate", format: "{0:MM/dd/yyyy}",type:"date", sortable:{ compare: function (a, b) {
var c = new Date(a.ReinsDepositDate);
var d = new Date(b.ReinsDepositDate);
return c - d;
}`
}}],
My Question is why I do that because kendo is given the date format and when I tried the sample demo with transport read with JSON file working fine with kendo format. Still in confusion.