简体   繁体   中英

how to show sum groupFooterTemplate in kendo grid UI

I have data and showing in kendo grid with group. Every group (Invoice No - VGBEL ) has a groupFooterTemplate but Quantity (LFIMG) column always 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.

 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. 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" } ] }); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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