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
600
Implement Remote Pagination for Ig grid Angular component
posted

Hello Team,

We are using ig-grid angular in our project. Right now using local pagination in which all the records are loaded at once and based on it, pagination details are shown. Need to implement remote pagination in which only selected records will be fetched. I have seen remote pagination example of ig-grid and don't think we can use those features as it is as we are only using ignite components on the frontend, not for the backend. Backend service to load the records is generic and is written in c#.

// Angular 

  <ig-grid [(options)]="gridOptions" [(dataSource)]="wrapperObjectDataSource"  ></ig-grid>

// c#

[HttpPost]
public IActionResult GetRecords([FromBody] CustomModel model)
{
try
{
GenericSearchResult result = searchService.getRecords(searchMetadata);

return Ok(result);
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
return BadRequest(ex.Message);
}
}

I have seen examples wherein remote pagination, the service call is made to c# service which uses ignite metadata (annotation). In my application, we provide filtering criteria also to the search service by using CustomModel object. Need to know how remote pagination can be implemented using angular component and c# service.

Thanks in advance...

Parents
No Data
Reply
  • 20255
    Offline posted

    Hey Dieter!

    Thank you for your question!

    There shouldn't be any difference whether using a C# service or other data service, as you may already checked - when performing a remote pagination we pass to the grid only the data for the current page, so the grid will not try to paginate the provided data source.

    It depends on you how the service will be implemented, only the Grid's paging configuration is important here, if you are using the default paging template `totalRecords` and `pagingMode` should be set, although if you are defining your own paging template, then a couple extra properties should be set, like skip, top and perPage. For more please refer to our documentation.

Children
No Data