1
Ich habe ein Problem beim Sortieren der dateTime für mein kendoUI-Gitter, siehe my grid snapshot, das Datum ist korrekt sortiert (sortiert von der neuesten dateTime), aber die Zeit ist nicht, wo " Jul/08/2016 15:04:22 "sollte auf der Oberseite sein (zeigte in meinem Schnappschuss), konnte jemand helfen, danke!Zeit nicht richtig sortiert KendoUI Grid
Mein Code:
self.gridDataSource = new kendo.data.DataSource({
sort: { field: "start_time", dir: "asc" },
schema: {
model: {
fields: {
start_time: { type: "date" },
}
}
}
});
self.myGrid = {
selectable: true,
resizable: true,
sortable: true, // todo: fix sorting issue
dataSource: self.gridDataSource,
filterable: true,
columns: {
field: "start_time",
title: "Start Time",
width: "180px",
filterable: false,
template: "#= kendo.toString(kendo.parseDate(start_time), 'MMM/dd/yyyy HH:mm:ss') #",
attributes: { style: "text-align: center; " },
format: "{0:MM/dd/yyyy}"
}
}
Was ist Ihnen Format zu diesem 'Format ändern: "{0: MM/tt/HH: mm: ss}"' –
Es ist nicht das Problem löst, ich glaube, ich habe zu Erstellen Sie einen Sortieralgorithmus dafür – gijonc