Hi guys,
I have few queries:
1. Is it possible, that the "Aggregated Value" of "sum" is updated as soon as I change any value of the column while bulk update. Currently it is updating on saving record.
2. How can I get this "Aggregated Value", as I have to use this in my formula (used in the change event of DataSource. I have mentioned "console.log" function in my code and I need to identify total of Foo, total of Foo with bar "A", "B" and "C" individually.
My code is as below:
Thanks for the help in advance.
I have few queries:
1. Is it possible, that the "Aggregated Value" of "sum" is updated as soon as I change any value of the column while bulk update. Currently it is updating on saving record.
2. How can I get this "Aggregated Value", as I have to use this in my formula (used in the change event of DataSource. I have mentioned "console.log" function in my code and I need to identify total of Foo, total of Foo with bar "A", "B" and "C" individually.
My code is as below:
var grid = $("#grid").kendoGrid({
dataSource: {
data: [
{foo: 10, bar: "A", total: 0},
{foo: 20, bar: "B", total: 0},
{foo: 5, bar: "B", total: 0},
{foo: 35, bar: "A", total: 0}
],
schema: {
model: {
fields: {
foo: { type: "number" },
bar: { type: "string" },
total: { type: "number" }
}
}
},
aggregate: [
{field: "foo", aggregate: "sum"},
{field: "foo", aggregate: "average"}
],
change: function(e) {
var item = e.items[0];
if (this.group().length && e.action !== "itemchange") {
item = getFirstItem(item);
}
console.log("Total Foo: ");
console.log("Total Foo of bar A: ");
console.log("Total Foo of bar B: ");
console.log("Total Foo of bar C: ");
}
},
//groupable: true,
editable: true,
toolbar: ["create", "save", "cancel"],
columns: [
{
field: "foo",
footerTemplate: "Sum1: #= sum # || Average: #= average #"
},
{
field: "bar"
},
{
field: "total"
}
]
}).data("kendoGrid");
Thanks for the help in advance.