Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LinkPager

LinkPager displays a list of hyperlinks that lead to different pages of target.

LinkPager works with a Pagination object which specifies the total number of pages and the current page number.

Note that LinkPager only generates the necessary HTML markups. In order for it to look like a real pager, you should provide some CSS styles for it. With the default configuration, LinkPager should look good using Twitter Bootstrap CSS framework.

For more details and usage information on LinkPager, see the pagination section in this guide.

author

Mahesh S Warrier https://github.com/codespede

Hierarchy

Index

Constructors

Properties

activePageCssClass: string = 'active'

The CSS class for the "active" page button.

disableCurrentPageButton: boolean = false

Whether to render current page button as disabled.

disabledListItemSubTagOptions: {} = {}

The options for the disabled tag to be generated inside the disabled list element. In order to customize the html tag, please use the tag key.

let disabledListItemSubTagOptions = { tag: 'div', class: 'disabled-div' };

Type declaration

  • [key: string]: any
disabledPageCssClass: string = 'disabled'

The CSS class for the "disabled" page buttons.

enablePjax: boolean = true

Whether to enable Pjax on this widget.

firstPageCssClass: string = 'first'

The CSS class for the "first" page button.

firstPageLabel: string | boolean = false

The label for the "first" page button. Note that this will NOT be HTML-encoded. If this property is false, the "first" page button will not be displayed.

hideOnSinglePage: boolean = true

Hide widget when only one page exist.

initialization: Promise<void>

A Promise which resolves when this Component has been successfully initialized.

lastPageCssClass: string = 'last'

The CSS class for the "last" page button.

lastPageLabel: string | boolean = false

The label for the "last" page button. Note that this will NOT be HTML-encoded. If this property is false, the "last" page button will not be displayed.

linkContainerOptions: {} = {}

HTML attributes which will be applied to all link containers

Type declaration

  • [key: string]: any
linkOptions: {} = {}

HTML attributes for the link in a pager container tag.

see

Html.renderTagAttributes for details on how attributes are being rendered.

Type declaration

  • [key: string]: any
maxButtonCount: number = 10

Maximum number of page buttons that can be displayed. Defaults to 10.

nextPageCssClass: string = 'next'

The CSS class for the "next" page button.

nextPageLabel: string | boolean = '&raquo;'

The label for the "next" page button. Note that this will NOT be HTML-encoded. If this property is false, the "next" page button will not be displayed.

options: {} = ...

HTML attributes for the pager container tag.

see

Html.renderTagAttributes for details on how attributes are being rendered.

Type declaration

  • [key: string]: any
pageCssClass: string

The CSS class for the each page button.

pagination: Pagination

The pagination object that this pager is associated with. You must set this property in order to make LinkPager work.

prevPageCssClass: string = 'prev'

The CSS class for the "previous" page button.

prevPageLabel: string | boolean = '&laquo;'

The label for the "previous" page button. Note that this will NOT be HTML-encoded. If this property is false, the "previous" page button will not be displayed.

autoIdPrefix: string = 'w'

The prefix to the automatically generated widget IDs.

see

getId

counter: number = 0

A counter used to generate id for widgets.

internal

Methods

  • getId(autogenerate?: boolean): string
  • Returns the ID of the widget.

    Parameters

    • autogenerate: boolean = true

    Returns string

    ID of the widget.

  • getPageRange(): [number, number]
  • init(): Promise<void>
  • registerAssets(): void
  • render(): Promise<string>
  • Renders a widget.

    throws

    InvalidArgumentException if the view file does not exist.

    Returns Promise<string>

    string the rendering result.

  • renderPageButton(label: string | number | boolean, page: number, cssClass: string, disabled: boolean, active: boolean): Promise<string>
  • Renders a page button. You may override this method to customize the generation of page buttons.

    Parameters

    • label: string | number | boolean

      the text label for the button

    • page: number

      the page number

    • cssClass: string
    • disabled: boolean

      whether this page button is disabled

    • active: boolean

      whether this page button is active

    Returns Promise<string>

    the rendering result

  • renderPageButtons(): Promise<string>
  • run(): Promise<string>
  • Executes the widget. This overrides the parent implementation by displaying the generated page buttons.

    Returns Promise<string>

Generated using TypeDoc