KendoUI datasource group and aggregate by multiple fields
<p>I'm trying to group a datasource by two fields and get the average or sum of their values.
But even if I specify both group and aggregate properties in the datasource, I can't get it.</p>

<p>Here is the code:</p>

<pre><code>var dataSource = new kendo.data.DataSource({
data: [
    { id: 1, name: "Amazon US", stock: 15, year: 2015},
    {id: 2,name: "Amazon US", stock: 20, year: 2016 },
    {id: 3,name: "Amazon US", stock: 7, year: 2016 },
    { id: 4, name: "Amazon EU", stock: 30, year: 2015 },
    { id: 5, name: "Amazon EU", stock: 7, year: 2015 },
    { id: 6, name: "Amazon EU", stock: 12, year: 2016 },
    { id: 7, name: "Amazon EU", stock: 26 , year: 2016}
      ],
schema: { // required if get method will be used
    model: {
        id: "id"
    }
}
})

dataSource.read();

dataSource.bind("change", function() {
    var log = $("#log");
    log.append("&lt;P&gt;total records in datasource is " + this.total() + "&lt;/p&gt;"  );
    var A = this.aggregates();        
    log.append("&lt;p&gt;total stock is " + A.stock.sum + "&lt;/p&gt;" );
})
.aggregate({ field: "stock", aggregate: "sum" });
</code></pre>

<p>And here a working example:
<a href="http://jsfiddle.net/rusev/NwG9A/2/" rel="nofollow">http://jsfiddle.net/rusev/NwG9A/2/</a></p>

<p>The expected result for the sum should be:</p>

<ul>
<li>AmazonUS | 2015 | 15 </li>
<li>AmazonUS | 2016 | 27 </li>
<li>AmazonEU | 2015 | 37</li>
<li>AmazonEU | 2016 | 38</li>
</ul>

<p>Does anyone have a clue if this is possible with the KendoUI datasource?</p>