我有一个kendo网格,我需要使用sortable:true
这个属性对我的数据进行排序。排序时需要大写首字母小写字母(如A B C a b c ....)。Kendo Grid可排序属性区分大小写问题
任何人知道的解决方案(我经历了许多博客,搜索这个,但我不能)
我有一个kendo网格,我需要使用sortable:true
这个属性对我的数据进行排序。排序时需要大写首字母小写字母(如A B C a b c ....)。Kendo Grid可排序属性区分大小写问题
任何人知道的解决方案(我经历了许多博客,搜索这个,但我不能)
您可以排序的数据源。因此,您可以将hidden
字段添加到DataSource并将其设置为小写。排序这个隐藏的领域。
下面是一个例子:
userNamen = [];
$.each(obj.users, function(i, el){
userNamen.push({ no: el.no,
name: el.ID,
email: el.email,
fax: el.faxDirect,
phone: el.phoneDirect,
toLowerCase: el.ID.toLowerCase()
});
})
$("##callTo").data("kendoDropDownList").setDataSource(userNamen);
$("##callTo").data("kendoDropDownList").dataSource.sort({ field: "toLowerCase",
dir: "asc" });
这里有一个解决方案,取代由数据源所用的比较器:
https://gist.github.com/JohannesHoppe/4161255
而这里的相关线索,我从该链接(这也Sankar的解决方案来自:)http://www.kendoui.com/forums/kendo-ui-web/grid/how-to-enable-case-insensitive-sorting-on-kendo-ui-grid.aspx
(请注意,不区分大小写的排序是apparen tly在新版本的Kendo UI中实现,所以你可能只想升级)
谢谢lars hoppner .. – Vicky