Home Reference Source
import {Paging} from 'tablefilter/src/modules/paging.js'
public class | source

Paging

Extends:

Feature → Paging

Paging UI component

Constructor Summary

Public Constructor
public

Creates an instance of Paging

Member Summary

Public Members
public

Css class for the paging buttons (previous, next, etc.)

public

First page button HTML

public

First page button text

public

Last page button HTML

public

Last page button text

public

Next page button HTML

public

Next page button text

public

Previous page button HTML

public

Previous page button text

public

Determines if paging buttons are enabled (default: true)

public

Determines if results per page is configured

public
public

Css class for the span containing total number of pages

public

Text after page selector drop-down

public

Callback fired after the page is changed

public

Callback fired before the page is changed

public

Number of rows contained in a page

public

pageLengthSlc: DOMElement

Results per page select DOM element

public

ID of custom container element for the results per page selector

public

Defines page selector type, two possible values: 'select', 'input'

public

pageSlc: DOMElement

Main select DOM element

public

Text preceeding page selector drop-down

public

Css class for the paging input element

public

Css class for the paging select element

public

Label and values for the results per page select, example of usage: ['Records: ', [10,25,50,100]]

public

Css class for the results per page select

public

Css class for the label preceding results per page select

public

ID of custom container element

public

Default position in toolbar ('left'|'center'|'right')

Method Summary

Public Methods
public

changePage(index: Number)

Change the page based on passed index

public

Change the number of results per page based on passed value

public

Remove paging feature

public

Return the current page number

public

groupByPage(validRows: Array)

Group table rows by page and display valid rows

public

init()

Initialize DOM elements

public

Change rows according to page results drop-down

public

Remove number of results per page UI elements

public

reset(filterTable: Boolean)

Reset paging when filters are already instantiated

public

Re-set page nb at page re-load

public

Re-set page length value at page re-load

public

Reset paging info from scratch after a filtering process

public

setPage(cmd: String}/{Number)

Show page defined by passed argument (string or number):

public

setPagingInfo(validRows: Array)

Calculate number of pages based on valid rows Refresh paging select according to number of pages

public

Generates UI elements for the number of results per page drop-down

Inherited Summary

From class Feature
public

TableFilter configuration

public

TableFilter emitter instance

public

TableFilter feature setting

public

Feature name

public

Field indicating whether Feature is initialized

public

TableFilter instance

public

Destroy the feature

public

Disable the feature

public

enable()

Enable the feature

public

init()

Initialize the feature

public

Indicate whether the feature is enabled or not

public

reset()

Reset the feature after being disabled

Public Constructors

public constructor(tf: TableFilter) source

Creates an instance of Paging

Override:

Feature#constructor

Params:

NameTypeAttributeDescription
tf TableFilter

TableFilter instance

Public Members

public btnCssClass: String source

Css class for the paging buttons (previous, next, etc.)

public btnFirstPageHtml: String source

First page button HTML

public btnFirstPageText: String source

First page button text

public btnLastPageHtml: String source

Last page button HTML

public btnLastPageText: String source

Last page button text

public btnNextPageHtml: String source

Next page button HTML

public btnNextPageText: String source

Next page button text

public btnPrevPageHtml: String source

Previous page button HTML

public btnPrevPageText: String source

Previous page button text

public hasBtns: Boolean source

Determines if paging buttons are enabled (default: true)

public hasResultsPerPage: Boolean source

Determines if results per page is configured

public initialized: boolean source

Field indicating whether Feature is initialized

Override:

Feature#initialized

public nbPgSpanCssClass: String source

Css class for the span containing total number of pages

public ofText: String source

Text after page selector drop-down

public onAfterChangePage: Function source

Callback fired after the page is changed

public onBeforeChangePage: Function source

Callback fired before the page is changed

public pageLength: Number source

Number of rows contained in a page

public pageLengthSlc: DOMElement source

Results per page select DOM element

public pageLengthTgtId: String source

ID of custom container element for the results per page selector

public pageSelectorType: String source

Defines page selector type, two possible values: 'select', 'input'

public pageSlc: DOMElement source

Main select DOM element

public pageText: String source

Text preceeding page selector drop-down

public pgInpCssClass: String source

Css class for the paging input element

public pgSlcCssClass: String source

Css class for the paging select element

public resultsPerPage: Array source

Label and values for the results per page select, example of usage: ['Records: ', [10,25,50,100]]

public resultsSlcCssClass: String source

Css class for the results per page select

public resultsSpanCssClass: String source

Css class for the label preceding results per page select

public tgtId: String source

ID of custom container element

public toolbarPosition: String source

Default position in toolbar ('left'|'center'|'right')

Public Methods

public changePage(index: Number) source

Change the page based on passed index

Params:

NameTypeAttributeDescription
index Number

Index of the page (0-n)

public changeResultsPerPage(val: String) source

Change the number of results per page based on passed value

Params:

NameTypeAttributeDescription
val String

The number of results per page

public destroy() source

Remove paging feature

Override:

Feature#destroy

public getPage(): Number source

Return the current page number

Return:

Number

Page number

public groupByPage(validRows: Array) source

Group table rows by page and display valid rows

Params:

NameTypeAttributeDescription
validRows Array

Collection of valid rows

public init() source

Initialize DOM elements

Override:

Feature#init

public onChangeResultsPerPage() source

Change rows according to page results drop-down

public removeResultsPerPage() source

Remove number of results per page UI elements

public reset(filterTable: Boolean) source

Reset paging when filters are already instantiated

Override:

Feature#reset

Params:

NameTypeAttributeDescription
filterTable Boolean

Execute filtering once paging instanciated

public resetPage() source

Re-set page nb at page re-load

public resetPageLength() source

Re-set page length value at page re-load

public resetPagingInfo() source

Reset paging info from scratch after a filtering process

public setPage(cmd: String}/{Number) source

Show page defined by passed argument (string or number):

Params:

NameTypeAttributeDescription
cmd String}/{Number

possible string values: 'next', 'previous', 'last', 'first' or page number as per param

public setPagingInfo(validRows: Array) source

Calculate number of pages based on valid rows Refresh paging select according to number of pages

Params:

NameTypeAttributeDescription
validRows Array

Collection of valid rows

public setResultsPerPage() source

Generates UI elements for the number of results per page drop-down