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

Get all datas filtered in virtualized or paged grid

6 Answers 1161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Licenses
Top achievements
Rank 1
Licenses asked on 14 Sep 2016, 03:23 PM

Hi,

 

I explain my need : 

When the user click on a button, I want to get all data on my grid with filters set on my grid to do an action. I can have a lot of datas (many thousand), in this case, the grid is virtualized. 

In this case : 

http://dojo.telerik.com/@muadhib/UnEsE/2

I add equal filter in ship country for get all rows where value is France.

When I click on "Get sum Freight", I want to get the sum of all rows which match. In my code, the sum take only 30 rows (1 page) from current page.

 

What is the best way to perform that ? 

 

Regards.

6 Answers, 1 is accepted

Sort by
0
Licenses
Top achievements
Rank 1
answered on 14 Sep 2016, 03:24 PM
To complete my post. I'm not in server paging, only in JS paging.
0
Licenses
Top achievements
Rank 1
answered on 15 Sep 2016, 07:16 AM

I have found a solution : 

var dataSource = $("#grid").data("kendoGrid").dataSource;
var filters = dataSource.filter();<br>var allData = dataSource.data();
var query = new kendo.data.Query(allData);
var data = query.filter(filters).data;

0
Dimiter Topalov
Telerik team
answered on 16 Sep 2016, 12:39 PM
Hello Christian,

Indeed, querying over all items with the current filter configuration, and ignoring the paging, is the only way to achieve the desired functionality. Please note that using this approach can potentially cause performance issues for very large data sets.

Let us know if you have other Kendo UI-related questions.

Regards,
Dimiter Topalov
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
0
Stephen
Top achievements
Rank 1
answered on 09 Jul 2019, 08:10 PM

Does this code still work today?  I'm trying with Kendo UI for MVC, 2019 January release and can only get the first ten records from my result.  Coincidentally, I've also got local side paging set to 10 as well.

How can one iterate through all filtered rows when they have paging enabled?

0
Stephen
Top achievements
Rank 1
answered on 10 Jul 2019, 08:26 PM

It turns out that I was specifiying this in my Kendo Grid setup.  Using this puts the DataSource in server pagination mode and no matter what, you cannot get the remaining rows unless you change your page size.  Since I am only doing local pagination I removed this attribute and everything worked perfectly. 

DataSource(ds => ds.Ajax()
    .ServerOperation(true)
0
Tsvetomir
Telerik team
answered on 11 Jul 2019, 11:41 AM
Hi Stephen,

It is correct that when the server operations of the Kendo UI Grid are enabled, you can access only the items which are loaded only the current page. This is done for performance purposes. If you would like to have access to all of the items in the data source, set the ServerOperation() property to false. This would force the grid to request all of the items in the data source the first time you load the grid. 

Let me know in case further information is required.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Licenses
Top achievements
Rank 1
Answers by
Licenses
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Stephen
Top achievements
Rank 1
Tsvetomir
Telerik team
Share this question
or