Kendo ui 剑道网格日期排序不能与M/d/yy正常工作

Kendo ui 剑道网格日期排序不能与M/d/yy正常工作,kendo-ui,kendo-grid,Kendo Ui,Kendo Grid,我已经浏览了互联网,还不能得出为什么这不起作用的结论,正如我在很多演示中看到的那样。我一定错过了一些简单的事情。。。除此之外,大多数示例不使用M/d/yy格式作为日期。当我使用此格式时,我的数据以如下列结束: 1/19/14 10/05/14 2/02/14 5/15/14 有什么想法吗?你们可以看到我的日期栏模板被注释掉了,因为它实际上并没有做任何改变 这是我的表格: $("#mygiving-details-grid").kendoGrid({ dataSource: {

我已经浏览了互联网,还不能得出为什么这不起作用的结论,正如我在很多演示中看到的那样。我一定错过了一些简单的事情。。。除此之外,大多数示例不使用M/d/yy格式作为日期。当我使用此格式时,我的数据以如下列结束:

1/19/14
10/05/14
2/02/14
5/15/14
有什么想法吗?你们可以看到我的日期栏模板被注释掉了,因为它实际上并没有做任何改变

这是我的表格:

$("#mygiving-details-grid").kendoGrid({
        dataSource: {
            schema: {
                model: {
                    fields:{
                        date: {type: "date"},
                        fund: {type: "string"},
                        desc: {type: "string"},
                        name: {type: "string"},
                        type: {type: "string"},
                        amt: {type: "number"}
                    }
                }
            }
        },
        sortable: true,
        toolbar: "<span>Filter goes here</span>",
        columns: [{
            field: "date",
            title: myGivingModel.local.giving.date,
            // format: "{0:"+systemDateFormat+"}",
            // template: "#= kendo.toString(date, '"+systemDateFormat+"') #",
            width: 100
        }, {
            field: "fund",
            title: myGivingModel.local.giving.fund
        }, {
            field: "desc",
            title: myGivingModel.local.giving.description
        }, {
            field: "name",
            title: myGivingModel.local.giving.name
        }, {
            field: "type",
            title: myGivingModel.local.giving.type
        }, {
            field: "amt",
            title: myGivingModel.local.giving.amount,
            attributes:{
                style:"text-align:right;"
            },
            format: "{0:c}"
        }]
    });
$(“#mygiving details grid”).kendoGrid({
数据源:{
模式:{
型号:{
字段:{
日期:{type:“date”},
基金:{type:“string”},
desc:{type:“string”},
名称:{type:“string”},
类型:{type:“string”},
金额:{type:“number”}
}
}
}
},
可排序:是的,
工具栏:“过滤器在这里”,
栏目:[{
字段:“日期”,
标题:myGivingModel.local.giving.date,
//格式:“{0:+systemDateFormat+”}”,
//模板:“#=kendo.toString(日期,”+systemDateFormat+”)#“,
宽度:100
}, {
字段:“基金”,
标题:myGivingModel.local.giving.fund
}, {
字段:“描述”,
标题:myGivingModel.local.giving.description
}, {
字段:“名称”,
标题:myGivingModel.local.giving.name
}, {
字段:“类型”,
标题:myGivingModel.local.giving.type
}, {
字段:“金额”,
标题:myGivingModel.local.giving.amount,
属性:{
样式:“文本对齐:右;”
},
格式:“{0:c}”
}]
});
使用此功能时应该可以正常工作。我刚刚在Scripts\common.js中更改了以下代码:

var _DefaultDateFormat = "MM/dd/yyyy";
// into this
var _DefaultDateFormat = "M/dd/yy";

排序也能按预期工作。

您能告诉我您的网格中需要什么日期格式吗?因为在我看来,你的日期是你告诉我的M/d/yy。(M-1/2位数月,d-2位数日,yy-2位数年)。好的,
systemDateFormat
变量将日期格式从服务器带回,以便在整个过程中使用。所以它很可能是一些不同的格式…我肯定不喜欢使用第三方插件,因为我已经看到这个功能在香草剑道平台上工作。正确。我只是想指出,问题可能出在服务器端,可能日期对象并不是真正解释为日期,而是服务器上的字符串。