I realize that these forums are chock full of posts about this, and I have read most of them yet my problem remains. I'm trying to use the most basic implementation of aggregates, and I keep getting the error 'sum is not defined' or as in my jsFiddle example 'count is not defined'. Could someone please take a look and tell me what I am doing wrong?
var
rawData = {
allData: [
{ employeeId: 1, departmentId: 2 },
{ employeeId: 2, departmentId: 1 },
{ employeeId: 3, departmentId: 3 },
{ employeeId: 4, departmentId: 2 }
],
employees: [
{ value: 1, text:
'John Smith'
},
{ value: 2, text:
'Jane Smith'
},
{ value: 3, text:
'John Doe'
},
{ value: 4, text:
'John White'
},
],
departments: [
{ value: 1, text:
'Dept A'
},
{ value: 2, text:
'Dept B'
},
{ value: 3, text:
'Dept C'
},
]
};
var
vm = {
dsAllData:
new
kendo.data.DataSource({
data: rawData.allData
})
};
$(document).ready(
function
() {
//kendo.bind($('#ui'), vm);
$(
'#myGrid'
).kendoGrid({
dataSource: vm.dsAllData,
groupable:
true
,
columns: [
{ field:
'employeeId'
, title:
'Employee'
,
values: rawData.employees, width: 200 },
{ field:
'departmentId'
, title:
'Department'
,
values: rawData.departments, width: 200,
aggrigate: [
'count'
], groupFooterTemplate:
'Count: #= count #'
}
]
});
});
Thanks, Jay