For an in depth guide on how to implement pagination, including on the server, see our Paginated Table Concept. All of the possible parameters are documented below. At its most basic, however, there are two ways to use FwPaginationWrapper in parameter form or in block form. Here is a brief example of each:

Parameter form:

<FwPaginationWrapper @modelName="myModel" @defaultSortKey="sortKey" @makeQuery={{action "makeQuery"}} @getTitle={{action "getTitle"}} @getTableColumns={{action "getTableColumns"}} @tableActions={{hash ...}} as |actions|>
  {{!-- Search panel contents --}}
  {{!-- actions.search and actions.export are defined for you to use in this section appropriately--}}
</FwPaginationWrapper>

Block form:

<FwPaginationWrapper @modelName="myModel" @defaultSortKey="sortKey" @makeQuery={{action "makeQuery"}} @getTitle={{action "getTitle"}} as |actions table|>
  {{#unless table}}
     {{!-- Search panel contents --}}
     {{!-- actions.search and actions.export are defined for you to use in this section appropriately--}}
  {{else}}
     {{!-- Table component invocation --}}
     {{!-- actions.sort and table.title, table.suffix, table.entries, and table.sortKey are defined for you to use in this section appropriately--}}
  {{/unless}}
</FwPaginationWrapper>
Show:
deletePage ()

Called to delete the full page of entries. Should be passed in with a function. Button will only appear if this is defined

export () Promise

This action is called when the export button is clicked to export all data. This is yielded in the block as actions.export.

Returns:

Promise:

Promise that resolves after exporting the table

getTableColumns () Array

Gets a list of table columns for exporting

Returns:

Array:

Array of table columns

getTableColumns () Array

Gets a list of table columns for the results. If null, yields for table

Returns:

Array:

Array of table columns

getTitle () String

Gets the title of this table at the given time

Returns:

String:

Title of this table

makeQuery
(
  • count
  • page
  • export
)
Object

Makes a query object based on the search fields

Parameters:

  • count Boolean

    If true, counting

  • page Number

    If defined, page number for a page search

  • export Boolean

    If true, exporting

Returns:

Object:

Query object

onSearch ()

Action to be called when the table search button is pressed.

queryAll () Promise private

Gets all entries for the given query. Internal method

Returns:

Promise:

Promise that resolves to entries

queryCount () Promise private

Queries the serverside to get the total record count. Internal method.

Returns:

Promise:

Promise that resolves to a number

queryPage
(
  • page
)
Promise
private

Fetches the entries for the given page number. Internal method

Parameters:

Returns:

Promise:

Promise that resolves to an entry array

querySort
(
  • page
  • sortKey
  • ascending
)
Promise
private

Query for settign a new sort order. Internal method.

Parameters:

  • page Number

    Page number to start

  • sortKey String

    New sort order

  • ascending Boolean

    If true, sorts ascending, false descending

Returns:

Promise:

Promise that resolves to a entry array

setPage
(
  • page
)
private

This action is called when a page button is clicked to switch pages. This is an internal action used in the page number button.

Parameters:

  • page Number

    New page number to set

sortColumn
(
  • column
  • sortKey
)
Promise

This action resorts the entry by the given column. This is yielded as actions.sort, when table is also defined. To be used in the onSort of your FwSortableTable.

Parameters:

  • column Column

    Column to use for sorting

  • sortKey String

    String to use for sorting in the column

Returns:

Promise:

Promise that resolves to entries

count

Number private

Total number of entries. Internal property set by the count network request.

currentEntries

Array - Computed

Array of entries at the current page

currentSortKey

String private

Current sort order for the table. Internal property to keep track of current sort key.

currentTitle

String private

Table title at this time. Internal property. Set by getTableTitle

defaultSortKey

String

Default sort order for the table

deletePagePermission

Boolean

Determines permission for deleteTablePermission for FwTableSortable. Should probably use a has-role helper from Group Control


Default: true

emptyText

String

Text to show for empty tables. If null, hides on empty

entriesPerPage

Number

Number of entries per page


Default: 100

filteredEntries

Array - Computed

Filtered entries, removing deleted entries

fullTableTitle

String - Computed

Title for the table

hideEmpty

Boolean - Computed

If true, hide the table when empty

index

Number - Computed

Array index for the selected page

lastQuery

Unknown

Query last time createQuery was called

maxPageButtons

Number - Computed

Maximum number of pages to show in the pagination component

modelName

String

Name of the model in search

page

Number private

Currently selected page. Internal property to be set by clicking one of the page numbers.


Default: 1

pageEntries

Array private

Array of entries, indexes are the pages. Internal Property for more quickly rendering pages that have been searched this time.

pagesSearching

Number private

Number of pages being searched. Internal property


Default: 0

routeName

String - Computed

Gets the serverside route to use for this model name

searchingTable

Boolean private

If true, currently doing the main search. Internal property set by search functionality.


Default: false

searchOnRender

Boolean

Whether or not the table loads on page load. If true, it will call the search based on your defaults already set, whenever the table is rendered for the first time.


Default: false

showExport

Boolean

If true, show export page button


Default: true

showPages

Boolean - Computed

True if we have multiple pages

showPagesBottom

Boolean

Show the page numbers below the table. If false, they won't show.


Default: true

showPagesTop

Boolean

Show the page numbers above the table. If false, they won't show.


Default: true

tableActions

Object

Actions to pass into the table. Should be a hash as usual

tableSortKey

String - Computed

Current table sort key based on given properties

tableSuffix

String - Computed

Final piece of title for table

tableWrapperClass

String

Class names for the wrapper around the loading spinner and the table

totalPages

Number - Computed

Number of pages available