这是我的网格设置:
$scope.documentSources = new kendo.data.DataSource({
transport: {
read: {
fun: console.log("Read"),
url: serviceBase + "Documents/GetListDocuments",
type: "POST",
dataType: "json",
contentType: 'application/json',
beforeSend: function (req) {
req.setRequestHeader('Authorization', authGlobalService.getAuthorizationData().token);
}
},
update: {
fun: console.log("Update"),
url: serviceBase + "Documents/GetListDocuments",
type: "POST",
dataType: "json",
contentType: 'application/json',
beforeSend: function (req) {
req.setRequestHeader('Authorization', authGlobalService.getAuthorizationData().token);
}
},
save: {
fun: console.log("Create"),
url: serviceBase + "Documents/SetDocument",
type: "POST",
dataType: "json",
data: 'hello hello',
contentType: 'application/json',
beforeSend: function (req) {
req.setRequestHeader('Authorization', authGlobalService.getAuthorizationData().token);
}
},
parameterMap: function (options) {
if (options.filter) {
options.filter = options.filter.filters;
}
return JSON.stringify(options);
}
},
sort: {
field: "dateAdded",
dir: "desc"
},
schema: {
data: "data",
total: "total"
},
pageSize: 10,
serverPaging: true,
serverSorting: true,
serverFiltering: true
});
$scope.msg = false;
$scope.documentListGridOptions = {
dataSource: $scope.documentSources,
selectable: 'row',
scrollable: false,
sortable: true,
resizable: true,
filterable: {
extra: false
},
pageable: true,
change: function (idSelectedVote) {
$scope.$apply(function () {
$scope.setSelected(idSelectedVote.sender.dataItem(idSelectedVote.sender.select()));
});
},
dataValueField: "id",
columns: [{
title: "Id dokumentu",
field: "documentid",
hidden: true
}, {
title: "Nazwa dokumentu",
field: "nameDocument",
}, {
title: "Opis",
field: "descriptionDocument",
}, {
title: "Data dodania",
field: "dateAdded",
template: "#= kendo.toString(kendo.parseDate(dateAdded, ''), 'MM/dd/yyyy HH:mm') #"
}, {
title: "Nazwa Pliku",
field: "fileName"
}]
};
我有一个问题,因为计算行并不起作用,因为我总是有一行。就像我下面的ss一样。
http://i.stack.imgur.com/56M7j.png
你能帮我解决这个问题吗?我的网格设置可能有问题。