Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface InternalTableParams<T>

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

Properties

data

data: T[] = []

The page of data rows currently being displayed in the table

isNullInstance

isNullInstance: boolean

reloadPages

reloadPages: function

Type declaration

    • (): void
    • Returns void

Methods

count

  • count(): number
  • count(count: number)

filter

generatePagesArray

  • generatePagesArray(currentPage?: number, totalItems?: number, pageSize?: number, maxBlocks?: number): Array<IPageButton>
  • Generate array of pages. When no arguments supplied, the current parameter state of this NgTableParams instance will be used

    Parameters

    • Optional currentPage: number

      Which page must be active

    • Optional totalItems: number

      Total quantity of items

    • Optional pageSize: number

      Quantity of items on page

    • Optional maxBlocks: number

      Quantity of blocks for pagination

    Returns Array<IPageButton>

    Array of pages

group

hasErrorState

  • hasErrorState(): boolean
  • Returns true when an attempt to reload the current parameter values have resulted in a failure. This method will continue to return true until the reload is successfully called or when the parameter values have changed

    Returns boolean

hasFilter

  • hasFilter(): boolean

hasFilterChanges

  • hasFilterChanges(): boolean

hasGroup

  • hasGroup(): boolean
  • hasGroup(group: string | IGroupingFunc<T>, sortDirection?: string): boolean

isDataReloadRequired

  • isDataReloadRequired(): boolean
  • Return true when a change to this instance should require the reload method to be run so as to ensure the data rows presented to the user reflects the current state.

    Note that this method will return false when the reload method has run but fails. In this case hasErrorState will return true.

    The built-in ngTable directives will watch for when this function returns true and will then call the reload method to load its data rows

    Returns boolean

isSortBy

  • isSortBy(field: string, direction?: string): boolean
  • Returns true if sorting by the field supplied. Where direction supplied the field must also be sorted by that direction to return true

    Parameters

    • field: string
    • Optional direction: string

    Returns boolean

orderBy

  • orderBy(): Array<string>

page

  • page(): number
  • page(page: number)

parameters

reload

  • reload<TResult>(): IPromise<TResult[]>

settings

sorting

total

  • total(): number
  • total(total: number)
  • Returns the count of the data rows that match the current filter

    Returns number

  • Sets settings().total to the value supplied. Typically you will need to set a total in the body of any custom getData function you supply as a setting value to this instance.

    example
    const tp = new NgTableParams({}, { getData: customGetData })
    function customGetData(params) {
         const queryResult = // code to fetch current data rows and total //
         params.total(queryResult.total);
         return queryResult.dataRowsPage;
    }
    

    Parameters

    • total: number

url

  • url(asString?: boolean): object
  • Returns the current parameter values uri-encoded. Set asString to true for the parameters to be returned as an array of strings of the form 'paramName=value' otherwise parameters returned as a key-value object

    Parameters

    • Optional asString: boolean

    Returns object

    • [name: string]: string

Static init

Generated using TypeDoc