Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ui/paging/Paging

Index

Variables

Const defaultPagingConfig

defaultPagingConfig: PaginationConfig = ...

Paging defaults

Functions

addPagingParams

  • addPagingParams(url: string, current: number | undefined, pageSize: number | undefined): string
  • Add paging params at the end of url string. Returns url with Note - expects that url has no params, so this method add '?' before params.

    Parameters

    • url: string

      params will be added to this url

    • current: number | undefined

      current page

    • pageSize: number | undefined

      page size

    Returns string

createPagingConfig

  • createPagingConfig(urlParams: string, disabled?: boolean, prevConfig?: PaginationConfig): { className?: string; current?: number; defaultCurrent?: number; defaultPageSize?: number; disabled?: boolean; hideOnSinglePage?: boolean; itemRender?: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", originalElement: ReactElement<HTMLElement, string | ((props: any) => null | ReactElement<any, any>) | (new (props: any) => Component<any, any, any>)>) => ReactNode; locale?: Object; onChange?: (page: number, pageSize?: number) => void; onShowSizeChange?: (current: number, size: number) => void; pageSize?: number; pageSizeOptions?: string[]; position?: "both" | "top" | "bottom"; prefixCls?: string; responsive?: boolean; role?: string; selectPrefixCls?: string; showLessItems?: boolean; showQuickJumper?: boolean | { goButton?: ReactNode }; showSizeChanger?: boolean; showTitle?: boolean; showTotal?: (total: number, range: [number, number]) => ReactNode; simple?: boolean; size?: "small" | "default"; style?: CSSProperties; total?: number } | { config: { className?: string; current?: number; defaultCurrent?: number; defaultPageSize?: number; disabled?: boolean; hideOnSinglePage?: boolean; itemRender?: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", originalElement: ReactElement<HTMLElement, string | ((props: any) => null | ReactElement<any, any>) | (new (props: any) => Component<any, any, any>)>) => ReactNode; locale?: Object; onChange?: (page: number, pageSize?: number) => void; onShowSizeChange?: (current: number, size: number) => void; pageSize?: number; pageSizeOptions?: string[]; position?: "both" | "top" | "bottom"; prefixCls?: string; responsive?: boolean; role?: string; selectPrefixCls?: string; showLessItems?: boolean; showQuickJumper?: boolean | { goButton?: ReactNode }; showSizeChanger?: boolean; showTitle?: boolean; showTotal?: (total: number, range: [number, number]) => ReactNode; simple?: boolean; size?: "small" | "default"; style?: CSSProperties; total?: number }; disabled: boolean }
  • Parameters

    • urlParams: string

      query params from 'location.history'

    • disabled: boolean = false

      set to true, if no pagination required for component

    • prevConfig: PaginationConfig = ...

      previous paging configuration, by default used Paging#defaultPagingConfig

    Returns { className?: string; current?: number; defaultCurrent?: number; defaultPageSize?: number; disabled?: boolean; hideOnSinglePage?: boolean; itemRender?: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", originalElement: ReactElement<HTMLElement, string | ((props: any) => null | ReactElement<any, any>) | (new (props: any) => Component<any, any, any>)>) => ReactNode; locale?: Object; onChange?: (page: number, pageSize?: number) => void; onShowSizeChange?: (current: number, size: number) => void; pageSize?: number; pageSizeOptions?: string[]; position?: "both" | "top" | "bottom"; prefixCls?: string; responsive?: boolean; role?: string; selectPrefixCls?: string; showLessItems?: boolean; showQuickJumper?: boolean | { goButton?: ReactNode }; showSizeChanger?: boolean; showTitle?: boolean; showTotal?: (total: number, range: [number, number]) => ReactNode; simple?: boolean; size?: "small" | "default"; style?: CSSProperties; total?: number } | { config: { className?: string; current?: number; defaultCurrent?: number; defaultPageSize?: number; disabled?: boolean; hideOnSinglePage?: boolean; itemRender?: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", originalElement: ReactElement<HTMLElement, string | ((props: any) => null | ReactElement<any, any>) | (new (props: any) => Component<any, any, any>)>) => ReactNode; locale?: Object; onChange?: (page: number, pageSize?: number) => void; onShowSizeChange?: (current: number, size: number) => void; pageSize?: number; pageSizeOptions?: string[]; position?: "both" | "top" | "bottom"; prefixCls?: string; responsive?: boolean; role?: string; selectPrefixCls?: string; showLessItems?: boolean; showQuickJumper?: boolean | { goButton?: ReactNode }; showSizeChanger?: boolean; showTitle?: boolean; showTotal?: (total: number, range: [number, number]) => ReactNode; simple?: boolean; size?: "small" | "default"; style?: CSSProperties; total?: number }; disabled: boolean }

parsePagingParams

  • parsePagingParams(locationSearch: string, currentPrev: number | undefined, pageSizePrev: number | undefined): PaginationConfig
  • Returns new PaginationConfig object with 'current' and 'pageSize' params, parsed from location.search. If param not found in search url, previous value (currentPrev, pageSizePrev) will be returned. If new pageSize not contains in config pageSizeOptions - previous config will be returned.

    Parameters

    • locationSearch: string

      trying to find paging params here

    • currentPrev: number | undefined

      previous value, will be returned in result if new value not found in locationSearch

    • pageSizePrev: number | undefined

      previous value, will be returned in result if new value not found in locationSearch

    Returns PaginationConfig

setPagination

  • setPagination<E>(pagination: PaginationConfig | TablePaginationConfig, dataCollection: DataCollectionStore<E>, reload?: boolean): void
  • Apply paginationConfig to collectionDataStore, reload dataStore if required

    Type parameters

    • E

    Parameters

    • pagination: PaginationConfig | TablePaginationConfig

      PaginationConfig

    • dataCollection: DataCollectionStore<E>

      -page size and current page will be set to this collection data store

    • reload: boolean = false

      reload collection data store, if needsr

    Returns void

Generated using TypeDoc