We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Switch between pagination and ifinityScroll

Hello, I want to switch between pagination and infinityScroll using external buttons. The first switch seems to work fine but then some errors comes out and it doesn't work anymore. Here is a stackblitz i have prepared as a demo. 

https://stackblitz.com/edit/angular-px7rqp-hykxiy?file=app.component.ts

Can you help me to find out what am i doing wrong and how can i make it work please.

Thanks in advance. 


1 Reply

DM Dineshnarasimman Muthu Syncfusion Team March 21, 2023 04:42 PM UTC

Hi Luca,


Thanks for contacting Syncfusion Support


Query : Switching between pagination and infinityScroll using external button


We have analyzed your query about switching between pagination and infinity scroll using external button , we replicated your sample and achieved your requirement. We suggest you to use enableScroll property as false in pagination button and true in scroll button using the infiniteOptions property. We have attached code snippet and a stackblitz sample for your reference.


 

  enablePagination(): void {

    this.infiniteOptions = { enableScroll: false };

    this.allowPaging = true;

  }

  enableInfinityScroll(): void {

    this.infiniteOptions = { enableScroll: true };

    this.allowPaging = false;

  }

 


Stackblitz Sample: https://stackblitz.com/edit/angular-px7rqp-s8qdjn?file=app.component.ts,app.component.html,app%2Fapp.module.ts


Please let us know if you need any further assistance.


Regards,

Dineshnarasimman


Loader.
Up arrow icon