Hi , am following this link mentioned in the example for Server side pagination. looks like some properties are deprecated. can you share the updated example along with below questions
in Compnent.html we have igx paginator and certain properties , events like below and corresponding action in ts file
instead of having in .ts file can we move all the logics to service or an separate file ? reason behind is to have seprate logics in seprate files can you share some example.
Hello,
Thank you for clarifying your requirement.
Of course, it is possible to programmatically set properties of Angular components in code even though this comes to the slight disadvantage of losing the commodity of the straightforward two-way binding capabilities. Here you can find a modified version of the documentation demo that achieves this. The paginator component can be queried in the .ts file using the ViewChild property decorator.
Please, take a look at the ngAfterViewInit hook in the sample’s RemotePagingDefaultTemplateComponent. I hope the example helps.
Best regards, Bozhidara Pachilova Associate Software Developer
Hey , Thanks for quick response.i saw the demo mentioned and it was helpful. the one am looking for is instead of having the below lines of code in component html. can we have this in html.ts or possibly in a service. that will be helpful
As mentioned in my previous reply, the Remote Data Operations shows useful demos on the matter, including Remote Paging. On the referenced link you could see the demo. If you open it in StackBlitz you will be able to check out all code files. Additionally, the sample has an isolated RemotePagingService, which contains the logic around calling the remote API and is injected in the component containing the grid.
I believe the documentation demos are what you are looking for in this case. Please, let me know if you need further information on the matter.
Best regards, Bozhidara Pachilova
Hey , thanks for the response. i understand it is an angular feature but it will be good how it is implemented with infragistcs example to give us an idea to think about how we can implement for our application. if you can share some stackbliz example that would be great
Thank you for posting to Infragistics Community!
To address your question about some properties being deprecated, yes as per our API pages for the IgxGridComponent the totalPages, page, nextPage, paginate, pageChange, pagingDone, and all the other properties, methods and events of the grid related to paging have been deprecated in version 12.1.0. These properties have been exposed on the igx-paginator component instead. All information on its usage including sample demons can be found in our documentation about Paging.
The Grid Remote Paging topic also uses the latest APIs in the demos, so it is a reliable source to refer to when implementing Server side pagination.
Regarding your last query about code-isolation, what I can say is that any logic can be extracted to separate files, services, etc., depending on the application’s architecture and code structure requirements. However, please, keep in mind that this is an entirely application-level concern and as such is out of the scope of the discussion about the IgxGrid’s paging capabilities and Infragistics support in general.
What I can recommend is reviewing the official Angular documentation, for example the Creating an injectable service topic.
If you require any further assistance with paging in the IgxGrid, please let me know.