value is ReinsDepositAmount
**
output
** i have recently stucked with one of the application date sorting in kendo ui grid.
In kendo grid , the column name is define 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 2.13/1/1992
- 23/1/2015
So i have put 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 kendo grid. when i doing a demo with json files , its working fine. But same thing apply 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 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.