Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
345
Manually set record count key in MVC wrapper
posted

Hey all, we're having an issue with the grid loading a little slow as our data grew more and more. The linq query that's being generated to pull the total record count is taking 6 seconds to pull while the query for the grid itself is only taking 1 second since it's a select top 50. Is there a way to manually set the query for total record count?

edit: Forgot to mention, we're using the older NetAdvantage jQuery 2012.1 build, haven't had time to redo the code for ignite ui.

Thanks,

Slin

Parents
No Data
Reply
  • 29417
    Offline posted

    Hello Slin,

     

    Thank you for posting in our forum.

     

    If you’re using the grid in a MVC project then when you have remote paging you need to define a DataSourceUrl from which the grid should retrieve the data. Usually in that url points to a an MVC action in which the whole data is returned and the grid builds the returned set based on the current page and  

    page size defined for the grid. The grid by default return the total count based on the data source returned in that action and generates a value in the response (TotalRecordsCount). In this case the grid is handling the records count in its internal logic based on the data you return in the action related to the DataSourceUrl ( the one marked with the GridDataSourceAction attribute) in which case it’s not needed to set any additional properties related to the TotalRecordCount.

    Otherwise generally in the paging features definition you can set the TotalRecordsCount property manually or define a different property from the resposne to be used as the total record count using the RecordCountKey property of the Paging feature. For example:

    features.Paging().PageSize(10).Type(OpType.Remote).RecordCountKey("YourKey");

     

    There’s an example with the grid with remote operations (sorting and paging) here:

    http://es.infragistics.com/products/jquery/sample/grid/remote-sorting

    Are you doing something similar on your side?

     

    I’m looking forward to your reply. 

    Best Regards,

    Maya Kirova

    Developer Support Engineer II

    Infragistics, Inc.

    http://es.infragistics.com/support

     

Children