我正在使用KendoUI网格并尝试依靠字段。我在另一个领域获得总和,这不会引起任何错误。令人惊讶的是,count也会返回值,但在控制台中会出现一堆错误 - TypeError:无法读取属性' count'未定义。这是我的HTML,请指教:
<kendo-grid [data]="gridData"
[pageSize]="state.take"
[skip]="state.skip"
[sort]="state.sort"
[sortable]="true"
[pageable]="true"
[scrollable]="'scrollable'"
[groupable]="true"
[group]="state.group"
[filterable]="true"
[filter]="state.filter"
(dataStateChange)="dataStateChange($event)"
[height]="500">
<kendo-grid-column field="EmployeeID" title="Employee ID" width="150" filter="numeric">
<ng-template kendoGridFooterTemplate
let-column="column">Tot Reps:{{aggregates["EmployeeID"].count}}</ng-template>
</kendo-grid-column>
<kendo-grid-column field="TotalHours" title="Total Hours" width="150" filter="numeric">
<ng-template kendoGridGroupFooterTemplate
let-group="group"
let-aggregates>Sum:{{aggregates["TotalHours"].sum}}</ng-template>
<ng-template kendoGridFooterTemplate
let-column="column">Tot Hours:{{total["TotalHours"]?.sum}}</ng-template>
</kendo-grid-column>
</kendo-grid>