Reputation: 115
I'm Ussing Kendo Grdi with Jquery. That grid has DateTime column. Data in that column shows like "/Date(1377196200000)/" . Help me to arrange this to proper format.
this is script of my grid;
function LoadGridView() {
var dataSource = GetDataSource();
$("#batchgrid").kendoGrid({
dataSource: dataSource,
editable: "inline",
selectable: "row",
toolbar: ["create"],
autobind: true,
reorderable: true,
pageable: {
refresh: true,
pageSizes: [5, 10, 20, 50, 100]
},
sortable: {
mode: "multiple"
},
sort: { field: "PrjNm", dir: "asc" },
groupable: {
messages: {
empty: "Drop columns here"
}
},
columnMenu: {
sortable: true,
filterable: true,
messages: {
columns: "Hide/Show Columns",
filter: "Apply filter",
sortAscending: "Sort (asc)",
sortDescending: "Sort (desc)"
}
},
resizable: true,
dataBinding: function () {
record = (this.dataSource.page() - 1) * this.dataSource.pageSize();
},
filterable: {
messages: {
and: "And",
or: "Or",
filter: "Apply filter",
clear: "Clear filter",
info: "Filter by"
},
extra: false, //do not show extra filters
operators: { // redefine the string operators
string: {
contains: "Contains",
doesnotcontain: "Doesn't contain",
startswith: "Starts With",
endswith: "Ends"
},
number: {
eq: "Is Equal To",
neq: "Not equal to",
gte: "Greater than or equal to",
lte: "Less than or equal to",
gt: "Greater than",
lt: "Less than"
}
}
},
navigatable: true,
columns: [
{ title: "No", template: "#= ++record #", width: 45 },
{ field: "ItemCode", title: "Item Code", width: "150px" },
{ field: "ItemName", title: "Item Name", format: "{0:c}", width: "300px" },
{ field: "PreviousDate", title: "Previous Date", type: "date", format: "{0:dd/MM/yyyy}" },
{ field: "PreviousValue", title: "Previous %", width: "110px", format: "{0:2}" },
{ field: "Value", t`enter code here`itle: "%", width: "150px", format: "{0:2}" },
{ command: ["edit"], title: " ", width: "175px" }
]
});
}
Upvotes: 2
Views: 2234
Reputation: 2560
Make sure your DataSource defines the date field type correctly (as date) in the model as is shown here :
model: {
fields: {
PreviousDate: { type: "date" },
}
}
Upvotes: 2