v5.20192.624
|

IPagedCollectionView Interface

Defines methods and properties that extend ICollectionView to provide paging capabilities.

Hierarchy

Implemented by

Properties

canChangePage

canChangePage: boolean

Gets a value that indicates whether the pageIndex value can change.

canFilter

canFilter: boolean

Gets a value that indicates whether this view supports filtering via the filter property.

canGroup

canGroup: boolean

Gets a value that indicates whether this view supports grouping via the groupDescriptions property.

canSort

canSort: boolean

Gets a value that indicates whether this view supports sorting via the sortDescriptions property.

currentItem

currentItem: any

Gets the current item in the view.

currentPosition

currentPosition: number

Gets the ordinal position of the current item in the view.

filter

filter: IPredicate

Gets or sets a callback used to determine if an item is suitable for inclusion in the view.

NOTE: If the filter function needs a scope (i.e. a meaningful 'this' value), then remember to set the filter using the 'bind' function to specify the 'this' object. For example:

  collectionView.filter = this._filter.bind(this);

groupDescriptions

groupDescriptions: ObservableArray

Gets a collection of GroupDescription objects that describe how the items in the collection are grouped in the view.

groups

groups: any[]

Gets the top-level groups.

isEmpty

isEmpty: boolean

Gets a value that indicates whether this view contains no items.

isPageChanging

isPageChanging: boolean

Gets a value that indicates whether the index is changing.

itemCount

itemCount: number

Gets the number of items in the view taking paging into account.

To get the total number of items, use the totalItemCount property.

Notice that this is different from the .NET IPagedCollectionView, where itemCount and totalItemCount both return the count before paging is applied.

items

items: any[]

Gets the filtered, sorted, grouped items in the view.

pageIndex

pageIndex: number

Gets the zero-based index of the current page.

pageSize

pageSize: number

Gets or sets the number of items to display on each page.

sortDescriptions

sortDescriptions: ObservableArray

Gets a collection of SortDescription objects that describe how the items in the collection are sorted in the view.

sourceCollection

sourceCollection: any

Gets or sets the collection object from which to create this view.

totalItemCount

totalItemCount: number

Gets the total number of items in the view before paging is applied.

To get the number of items in the current view not taking paging into account, use the itemCount property.

Notice that this is different from the .NET IPagedCollectionView, where itemCount and totalItemCount both return the count before paging is applied.

Methods

beginUpdate

  • beginUpdate(): any

contains

  • contains(item: any): boolean
  • Returns a value that indicates whether a given item belongs to this view.

    Parameters

    • item: any

      The item to locate in the collection.

    Returns boolean

deferUpdate

  • deferUpdate(fn: Function): any
  • Executes a function within a beginUpdate/endUpdate block.

    The collection will not be refreshed until the function has been executed. This method ensures endUpdate is called even if the function throws.

    Parameters

    • fn: Function

      Function to be executed within the beginUpdate/endUpdate block.

    Returns any

endUpdate

  • endUpdate(): any

implementsInterface

  • implementsInterface(interfaceName: string): boolean
  • Returns true if the object implements a given interface.

    Parameters

    • interfaceName: string

      Name of the interface to look for.

    Returns boolean

moveCurrentTo

  • moveCurrentTo(item: any): boolean

moveCurrentToFirst

  • moveCurrentToFirst(): boolean

moveCurrentToLast

  • moveCurrentToLast(): boolean

moveCurrentToNext

  • moveCurrentToNext(): boolean

moveCurrentToPosition

  • moveCurrentToPosition(index: number): boolean

moveCurrentToPrevious

  • moveCurrentToPrevious(): any

moveToFirstPage

  • moveToFirstPage(): boolean
  • Sets the first page as the current page.

    Returns boolean

moveToLastPage

  • moveToLastPage(): boolean
  • Sets the last page as the current page.

    Returns boolean

moveToNextPage

  • moveToNextPage(): boolean
  • Moves to the page after the current page.

    Returns boolean

moveToPage

  • moveToPage(index: number): boolean
  • Moves to the page at the specified index.

    Parameters

    • index: number

      Index of the page to move to.

    Returns boolean

moveToPreviousPage

  • moveToPreviousPage(): boolean
  • Moves to the page before the current page.

    Returns boolean

refresh

  • refresh(): any
  • Re-creates the view using the current sort, filter, and group parameters.

    Returns any

Events

collectionChanged

collectionChanged: Event

Occurs when the collection changes.

currentChanged

currentChanged: Event

Occurs after the current item changes.

currentChanging

currentChanging: Event

Occurs before the current item changes.

pageChanged

pageChanged: Event

Occurs after the page index changes.

pageChanging

pageChanging: Event

Occurs before the page index changes.