For the complete documentation index, see llms.txt. This page is also available as Markdown.

Pagination

Pagination is enabled by default and shows 12 records per page.

Config

var dashboard = new FutureLabs.Dashboard({
  config: {
    tabs: {
      'User Profiles': {
        itemsPerPage: 12,   // defaults to 12
        page: 1             // the page to open on, 1-based
      }
    }
  }
});
itemsPerPage number

Records per page. Defaults to 12. Set per tab.

page number

The page to start on. 1-based. Defaults to 1.

Paging from code

Property
What it is

page

Current page, 1-based.

pages

Total pages, derived from count and itemsPerPage.

count

Total records. From the server when fetching.

Paging on the server

When a tab fetches, only one page is ever in memory. page and itemsPerPage are sent with every request and the server returns that slice plus a total:

count is what drives the pager β€” without it DashboardJS cannot know how many pages exist. See Fetch API.

Updating the total without reloading

setCount() updates the total and the pager while leaving the rows on screen alone:

This is what a count-only load uses. Passing such a response through setData() would blank a populated tab, because a count-only response carries an empty list.

Rapid clicks

Only one page change runs at a time. A click arriving mid-flight is queued and runs when the active one finishes, and further clicks replace that queued one rather than stacking β€” so a burst of clicks settles on the last page you asked for instead of racing.

Last updated