【发布时间】:2015-10-07 08:39:51
【问题描述】:
我正在使用 Telerik Kendo Grid;当我的数据源(数组)如下所示时,它不允许使用表的可排序功能:
var myArray = [
{ Destination = { Country: "United Kingdom", AircraftTypeCount: 9 }, Origin= [ {Country: "United States", Code: "JFK"} ] },
{ Destination = { Country: "Egypt", AircraftTypeCount: 5 }, Origin= [ {Country: "Qatar", Code: "QR"} ] }]
它可以很好地呈现国家/地区列,但是当我单击该列时,不会发生排序。下面是我的剑道网格(使用 AngularJS):
$("#myKendoTable").kendoGrid({
dataSource: {
data: myArray
},
sortable: {
mode: "multiple",
allowUnsort: true
},
columns: [
{
field: "Country",
title: "Country",
width: 300,
template: function (item) {
return item["Destination"].Country;
}
}
]
});
【问题讨论】: