Get all datas filtered in virtualized or paged grid

4 posts, 0 answers
  1. Christian
    Christian avatar
    14 posts
    Member since:
    Nov 2015

    Posted 14 Sep Link to this post

    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.

  2. Christian
    Christian avatar
    14 posts
    Member since:
    Nov 2015

    Posted 14 Sep in reply to Christian Link to this post

    To complete my post. I'm not in server paging, only in JS paging.
  3. Kendo UI is VS 2017 Ready
  4. Christian
    Christian avatar
    14 posts
    Member since:
    Nov 2015

    Posted 15 Sep Link to this post

    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;

  5. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    347 posts

    Posted 16 Sep Link to this post

    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.
Back to Top
Kendo UI is VS 2017 Ready