or
We have a datasource that has groups and aggregates specified.
dataSourcePipeline = new kendo.data.DataSource({ transport: { read: { url: "/Market/Pipeline", dataType: "json", type: "get", cache: true, data: { zip: zip } } }, group: { field: "Stage", dir: "desc", aggregates: [ { field: "PropertyName", aggregate: "count" }, { field: "Area", aggregate: "sum"}] }, aggregate: [ { field: "PropertyName", aggregate: "count" }, { field: "Area", aggregate: "sum" } ], sort: { field: "Area", dir: "desc" }});We have a grid bound to that datasource and is configured to allow grouping. Further, we have specified a groupFooterTemplate for one of the columns that displays the aggregate.
$("#marketPipeline").kendoGrid({ dataSource: dataSourcePipeline, groupable: true, scrollable: false, sortable: { mode: "multiple" }, filterable: true, columns: [ { field: "PropertyName", title: "Property Name", template: '<div style="cursor: pointer;" class="pipelinePopupTrigger" rel="#=ID#"><img src="/Content/images/mapIcon.png" height="20" style="cursor: pointer; padding-right: 10px;" title="Show on map" onClick="CenterMap(#=Lat#,#=Lng#,\'PIPELINE\',\'#=ID#\')"/> #=PropertyName#</div>', footerTemplate: "Total Count: #=count#", groupFooterTemplate: "Count: #=count#" }, { field: "Address", title: "Address" }, { field: "City", title: "City" }, { field: "ZipCode", title: "Zip Code", width: 100, footerTemplate: "<span style='float:right'>Total Area:</span>", groupFooterTemplate: "<span style='float:right'>Area</span>" }, { field: "Area", title: "Area", template: '<span style="float:right">#= kendo.toString(Area,"N0") #</span>', width: 100, footerTemplate: "<span style='float:right'>#= kendo.toString(sum,'N0') #</span>", groupFooterTemplate: "<span style='float:right'>#= kendo.toString(sum,'N0') #</span>" }, { field: "Subclass", title: "Sub-Class" }, { field: "Stage", title: "Stage", width: 200 } ] });Everything works well until the user removes all groups for the grid. Once they drag a new column to the group area, the grid fails with this error:
count is not defined
/Scripts/kendo/kendo.web.min.js
Line 10
Thoughts?
for (var i = 0; i < 5; i++) { var entryIndex = "entries[" + i + "]"; columns.push({ field: entryIndex, title: "Column " + i });}