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

Paging

`ff-paging` builds pagination controls from FactFinder paging data. Use `ff-paging-set` and `ff-paging-item` to define links for each pagination state.

Documentation

With the ff-paging element, you can build a custom paging for your search results.

A paging may contain several ff-paging-set elements, and each ff-paging-set element contains several ff-paging-item elements.

You can access the page number a paging item represents with the {{page}} syntax.

<ff-paging id="paging2">
    <ff-paging-item type="currentLink -2">{{page}}</ff-paging-item>
    <ff-paging-item type="currentLink -1">{{page}}</ff-paging-item>
    <ff-paging-item type="currentLink" style="font-weight: bold;">{{page}}</ff-paging-item>
    <ff-paging-item type="currentLink +1">{{page}}</ff-paging-item>
    <ff-paging-item type="currentLink +2">{{page}}</ff-paging-item>
</ff-paging>

show-only

When the show-only attribute is present, the paging does not react to clicks.

<ff-paging show-only>
    //...
</ff-paging>

paging-set

Define different ff-paging-set elements based on which page you are on right now.

The state attribute is evaluated as a boolean expression. When its value is true, the ff-paging-set is visible.

The possible variables to build the expressions are currentPage, pageCount, and numeric values.

paging-item

You can style the different ff-paging-item elements and define which links you want to display in a given paging-set.

This might look cumbersome and bloated, but it gives a very defined and in-depth way to design your paging element.

You have to set a type attribute in the ff-paging-item where you select a "page". This is an expression built from the possible values below:

  • firstLink: Points to the first page.

  • lastLink: Points to the last page.

  • nextLink: Points to the next page if available. (currentPage +1)

    • Usually this link is displayed as an arrow or something similar.

  • previousLink: Points to the previous page if available. (currentPage -1)

    • Usually this link is displayed as an arrow or something similar.

  • currentLink: Points to the current page. You can add or subtract to define a specific page like currentLink+2 or currentLink-1.

The ff-paging-item will only be visible when the expression resolves to a valid page.

The paging-item also has a show-only attribute and works like the show-only on the paging itself.

Between the ff-paging-items, you can add placeholders such as .... They will always be visible.

Rendered HTML

The template you provide in an ff-paging-item tag will be rendered inside a wrapping div:

Example implementation

Demo

API

ff-paging

Properties

Name
Description

paging (Object) (default: empty)

The paging data from FactFinder.

show-only (Boolean)

Determines if page items should only be displayed and not clickable.

Events

Name
Description

dom-updated

This event is triggered when the element has received new data and the template for this element and all sub elements have been punched out.

ff-paging-set

Properties

Name
Description

state (String) (default: "all")

Sets the condition under which ff-paging-set becomes active. Use currentPage and pageCount in a calculation, such as currentPage > 3 && pageCount - currentPage >= 3.

isActive (Boolean)

Determines if the paging set is currently active.

paging (Object) (default: empty)

The data from FactFinder.

Methods

Name
Description

hideSelf()

Hides the paging set.

showSelf()

Shows the paging set.

ff-paging-item

Properties

Name
Description

type (String) Options: "currentLink", "firstLink", "lastLink", "nextLink", "previousLink" (default: "currentLink")

Configures and styles pages and navigation elements.

show-only (Boolean)

Determines if page items should only be displayed and not clickable.

page (Number)

The page number the item represents.

Last updated

Was this helpful?