This is a migrated thread and some comments may be shown as answers.

Grid with aggregates data bug

1 Answer 116 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Oren asked on 17 Jun 2014, 12:00 PM
Hello ,
maybe you can help me with some issue.

I use kendo grid, I have grid with
aggregates data, and it looks like that:

(attach as grid.jpg)

Aggregates: (I don't use all the aggregates)
(attach as Aggregates.jpg)

I save the grid state (paging, grouping,
sorting, filtering and aggregates) in cookie as (Java Script):

var gridState = {           
       pageSize: dataSource.pageSize(),           
       sort: dataSource.sort(),           
       filter: dataSource.filter(),
      aggregates: dataSource.aggregates()

Cookie (JSON) (Result of saving):

And I try to restoring the grid from
cookie that I already save, I loaded it like that:

Restoring the grid state: (paging, grouping , sorting and filtering)
if (gridState!= '' && gridState!= null) {   

But unfortunately is not work when I use
aggregate, an exception was throw:
"Uncaught ReferenceError: count is not defined"

And I don't understand it because I have count:
(attach as count.jpg)

Anyway those errors occurs just when I started use aggregates. before it, everything work just fine!

Thanks in advance.


1 Answer, 1 is accepted

Sort by
Alexander Popov
Telerik team
answered on 19 Jun 2014, 08:59 AM
Hello Oren,

The DataSource's aggregates method returns an object containing the result of the aggregates. When querying the DataSource, you need to pass not the values, but the configuration of the aggregates, so the DataSource could re-calculate them based on the current data. You can get the configuration using the aggregate method (not to be confused with aggregates).

Alexander Popov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question