简体   繁体   English

如何在剑道网格UI中显示sum groupFooterTemplate

[英]how to show sum groupFooterTemplate in kendo grid UI

I have data and showing in kendo grid with group. 我有数据并在Kendo网格中与组一起显示。 Every group (Invoice No - VGBEL ) has a groupFooterTemplate but Quantity (LFIMG) column always 0,00. 每个组(发票编号-VGBEL)都有一个groupFooterTemplate,但“数量(LFIMG)”列始终为0,00。 I need sum of Quantity every footer. 我需要每个页脚的数量总和。 Where is my mistake ? 我的错误在哪里? I searched on the internet but didnt find solution. 我在互联网上搜索,但未找到解决方案。 I know there is a little mistake but I didnt find it. 我知道有一个小错误,但我没有发现。

This my JS code. 这是我的JS代码。

 var kendoResource = getKendoResourceOptions(); options.columns[0].groupFooterTemplate = 'Sipariş Toplamı:'; options.columns[8].groupFooterTemplate = '#: data.LFIMG ? kendo.format("{0:C2}",data.LFIMG.sum): 0,00 #'; $("#grid").kendoGrid({ toolbar: [{ name: "excel", text: kendoResource.toolbar.messages.excel }], excel: { fileName: "DeliveryList.xlsx", allPages: true, filterable: true }, groupable: kendoResource.groupable, scrollable: true, sortable: true, pageable: kendoResource.pageable, columns: options.columns }); self.filterClick = function () { showLoading(); mbisPost('Reports.Summary', "/api/TermoTeknikReportApi/DeliveryList", ko.toJS(self.filters), function (result) { if (result && result.length > 0) { self.showNoDataToDisplay(false); var dataSource = new kendo.data.DataSource({ data: result, pageSize: 100, group: { field: "VGBEL", }, aggregate: [ { field: "LFIMG", aggregate: "sum" } ] }); var grid = $("#grid").data("kendoGrid"); grid.setDataSource(dataSource); // element for which the tooltip is shown grid.thead.kendoTooltip({ filter: "th", content: function (e) { var target = e.target; return $(target).text(); } }); } else { self.showNoDataToDisplay(true); } }).error(function () { hideLoading(); }).done(function () { hideLoading(); }); } 

Screenshot of webpage 网页截图

在此处输入图片说明

I changed dataSource code. 我更改了dataSource代码。 put the "aggregates" properties into the group 将“聚合”属性放入组

 var dataSource = new kendo.data.DataSource({ data: result, pageSize: 100, group: { field: "VGBEL", aggregates: [ { field: "LFIMG", aggregate: "sum" },{ field: "LFIMG_M", aggregate: "sum" }] // this line }, aggregate: [ { field: "LFIMG", aggregate: "sum" },{ field: "LFIMG_M", aggregate: "sum" } ] }); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM