4 Answers, 1 is accepted
0
Sam
Top achievements
Rank 2
answered on 24 Apr 2018, 02:52 PM
Please see the browser console output.
0
Sam
Top achievements
Rank 2
answered on 24 Apr 2018, 03:06 PM
Please see the browser console output.
0
Sam
Top achievements
Rank 2
answered on 24 Apr 2018, 03:08 PM
var
ds =
new
kendo.data.DataSource({
data: [
{
"foo"
: {
"bar"
: 10}},
{
"foo"
: {
"bar"
: 10}},
{
"foo"
: {
"bar"
: 10}},
{
"foo"
: {
"bar"
: 20}}
],
aggregate: [
{field:
"foo.bar"
, aggregate:
"sum"
}
]
})
ds.read();
console.log(
'results'
, ds.view().length);
console.log(
'aggregates'
, ds.aggregates());
console.log(
'run filter'
)
ds.query({filter:{field:
"foo.bar"
, operator:
"eq"
, value: 20}})
console.log(
'results'
, ds.view().length);
console.log(
'aggregates'
, ds.aggregates());
0
Hello Sam,
The dataSource's query() method resets the aggregate configuration by default. Therefore, to maintain it in the query result you can pass it as follows:
Regards,
Dimitar
Progress Telerik
The dataSource's query() method resets the aggregate configuration by default. Therefore, to maintain it in the query result you can pass it as follows:
<script>
ds.query({filter:{field:
"foo"
, operator:
"eq"
, value: 20}, aggregate: ds.aggregate()}).then(
function
() {
console.log(
'results'
, ds.view().length);
console.log(
'aggregates'
, ds.aggregates());
})
</script>
Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.