v5.20191.605
|

IEditableCollectionView Interface

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

Hierarchy

Implemented by

Properties

canAddNew

canAddNew: boolean

Gets a value that indicates whether a new item can be added to the collection.

canCancelEdit

canCancelEdit: boolean

Gets a value that indicates whether the collection view can discard pending changes and restore the original values of an edited object.

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.

canRemove

canRemove: boolean

Gets a value that indicates whether items can be removed from the collection.

canSort

canSort: boolean

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

currentAddItem

currentAddItem: any

Gets the item that is being added during the current add transaction.

currentEditItem

currentEditItem: any

Gets the item that is being edited during the current edit transaction.

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.

isAddingNew

isAddingNew: boolean

Gets a value that indicates whether an add transaction is in progress.

isEditingItem

isEditingItem: boolean

Gets a value that indicates whether an edit transaction is in progress.

isEmpty

isEmpty: boolean

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

items

items: any[]

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

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.

Methods

addNew

  • addNew(): any
  • Adds a new item to the collection.

    Returns any

    The item that was added to the collection.

beginUpdate

  • beginUpdate(): any

cancelEdit

  • cancelEdit(): any
  • Ends the current edit transaction and, if possible, restores the original value to the item.

    Returns any

cancelNew

  • cancelNew(): any
  • Ends the current add transaction and discards the pending new item.

    Returns any

commitEdit

  • commitEdit(): any
  • Ends the current edit transaction and saves the pending changes.

    Returns any

commitNew

  • commitNew(): any
  • Ends the current add transaction and saves the pending new item.

    Returns 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

editItem

  • editItem(item: any): any
  • Begins an edit transaction of the specified item.

    Parameters

    • item: any

      Item to edit.

    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

refresh

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

    Returns any

remove

  • remove(item: any): any
  • Removes the specified item from the collection.

    Parameters

    • item: any

      Item to remove from the collection.

    Returns any

removeAt

  • removeAt(index: number): any
  • Removes the item at the specified index from the collection.

    Parameters

    • index: number

      Index of the item to remove from the collection.

    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.