大家好,我对Kendo网格分组有几个疑问:
这是我的配置:
self.gridOptions = {
autoBind: false,
dataSource: {
pageSize: 100,
serverGrouping: false,
serverPaging: true,
serverSorting: true,
transport: {
read: loadDataSource,
cache: false
},
group: [
{
field: "SugCheck"
},
{
field: "KvutzaEZ", aggregates: [
{ field: "KvutzaEZ", aggregate: "count" },
{
field: "Sky425SchumEZ", aggregate: "sum"
}
]
}
],
schema: {//data mapping in response
data: "ResponseBody",
total: "totalHeaders"
}
},
pageable: {
numeric: false,
buttonCount: 0,
pageSize: 100,
messages: {
empty: '',
display: languageService.getActiveLanuage() === "en-gb" ? "{0}-{1}" : "{1}-{0}"
}
},
dataBound: function (e) {
// check for avaliable data (if no data found hide grid and show notification)
var cheques = [];
_.each(e.sender._data, function (element, index) {
element.index = index;
cheques.push(element);
});
skyOshMainService.setCheques(cheques);
if (e.sender._data.length === 0) {
self.isGridEmpty = true;
}
else {
self.isGridEmpty = false;
}
},
serverGrouping: false,
scrollable: false,
sortable: {
mode: "single",
allowUnsort: false
},
//sortable: false
columns: [.....
]
};
我使用了一个按钮,当单击“ make”时:
self.gridObj.dataSource.group([
{ field: "SugCheck" },
{
field: "KvutzaEZ", aggregates: [
{ field: "KvutzaEZ", aggregate: "count" },
{ field: "Sky425SchumEZ", aggregate: "sum" }
]
}
]);
然后当我调试时,我看到它转到loadDataSource函数。 我可以在客户组中吗?
顺便说一句,我注意到在分组时顺序已更改。分组时如何确定排序顺序?