How to use Infinite Scroll

This tutorial explains how to use the Infinite Scroll feature of the datasource, which is introduced with Formspider Desktop 1.6.0. This feature allows you to load rows from the datasource continuously as the user scrolls down the grid bound to the datasource.

You may click here to run the demo application.

To enable Infinite Scroll in your datasource, open the datasource edit dialog and select “Infinite Scroll” from the “Fetch Mode” combobox:

Selecting the “Infinite Scroll” option

Note that as soon as the “Infinite Scroll” option is selected, two new options become available:

First Fetch Size is the number of rows which will be sent to the grid when the datasource is queried the first time. The default value of this attribute is 20.

Query Type determines how the query result will be fetched into the datasource:

  • “Query As Needed”: The query result will be fetched partially, as the user scrolls down the grid. In this mode, the datasource will execute its query every time the user scrolls down the grid to fetch new rows into the datasource and send them to the grid.
  • “Query All”: When the datasource executes its query it fetches the entire rowset but only sends the first rows (specified by the First Fetch Size attribute) to the grid and continues to supply the additional rows from the datasource as the user scrolls down. Since all the result set is already in the datasource, it does not need to execute its query again.

When to use Infinite Scroll?

We prepared the table below to help you choose which Fetch Mode to use for your datasources. The decision depends on the size of the datasource’s result set and whether the datasource is editable or not. For our recommendation we used Small, Medium and Large data sizes and avoided to provide exact numbers because the actual numbers might vary greatly depending on the horsepower of your database and the load it has to handle.

DML / Size Small Medium Large
Editable Fetch All Infinite Scroll(Query All) Infinite Scroll(Query As Needed). Use a 2nd single row datasource to edit
Non-Editable Fetch All Infinite Scroll(Query As Needed) Paging