Implementing pagination on a dataset
Every dataset code component will need to implement pagination because when you configure your code component on a sub-grid or a view of the application, it provides you with a way to configure the number of records that will be initially displayed by your control. By default, on a sub-grid, this setting is set to 10 records, and on a view, it is set to 50 records.
If you recall when we built the dataset code component in Chapter 5, Code, Test, and Repeat, we added a Load More... button on the dataset that shows up when additional pages are available but is hidden when no additional pages are available. At that time, we did not add any logic to this button that would implement showing the data from those additional pages.
Now, we will add an event listener on this button in the init method and bind it to a function that will perform pagination. The following is the code for the function that will perform the pagination:
index.ts
private...