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

Custom aggregates with paging

2 Answers 137 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 15 Jun 2017, 11:31 AM

Dear,

We have run into an issue regarding custom footer templates in combination with paging. We have an MVC grid with an Ajax datasource and clientside filtering. So we return a few thousands rows from our controller action, and let the grid control the paging and filtering. So far so good...

However we'd like to add an aggregate for standard deviation. We know how to pass cell values through a javascript function from a ClientTemplate and ClientFooterTemplate. However as you can guess, these functions do only get called for the items on the current page. So our stddev is based on 500 items only (our page size) instead of the complete grid.

Question: since the grid control itself is able to access all of its items while building up the default aggregates (count,min/max etc.) is there a way for us to access these non-visible items as well?

We tried to look at the client grid.dataSource, but this only includes the items on the page. Or is there a property we have overlooked? All items must be somewhere since the grid has uses them too, right?

We'd like to know our options before deciding to move to server side filtering, because that's quite a change from how we envisioned our app to work..

Thanks in advance!

 

 

2 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 19 Jun 2017, 08:37 AM
Hi Mark,

If you are returning the full set of data into the DataSource, then you should be able to access it using the data() method of the DataSource, as opposed to the view() method, which only returns the current page of data. If the data() method does not return the entire data, then check again the response from your controller method to confirm that indeed all records are returned. 
If the problem with accessing all items persists, please show us the DataSource definition.

Regards,
Tsvetina
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mark
Top achievements
Rank 1
answered on 05 Jul 2017, 03:13 PM

Thanks Tsvetina,

I am indeed able to get all the data now. I should be fine from here.

Sorry for late reply, i was out of office for a while.

Best regards

Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Mark
Top achievements
Rank 1
Share this question
or