Interface IListBinding

Retrieves items from a IListDataSource, enumerates the contents of a IListDataSource, and can optionally register for change notifications.

Index

Methods

Methods

public current(): IItemPromise

Retrieves the current item.

Returns

IItemPromise

An IItemPromise that contains the current item. If the cursor has moved past the start or end of the list, the promise completes with a value of null. If the current item has been moved or deleted, the promise returns an error.

public first(): IItemPromise

Gets the first item from the IListDataSource and makes it the current item.

Returns

IItemPromise

An IItemPromise that contains the requested IItem. If the list is empty, the promise completes with a value of null.

public fromDescription(description: string): IItemPromise

Retrieves the item from the IListDataSource that has the specified description and makes it the current item.

Parameters

  • description: string

    A domain-specific description, to be interpreted by the IListDataAdapter, that identifies the item to retrieve.

Returns

IItemPromise

An IItemPromise that contains the requested IItem object. If the item wasn't found, the promise completes with a value of null.

public fromIndex(index: number): IItemPromise

Retrieves the item from the IListDataSource that has the specified index and makes it the current item.

Parameters

  • index: number

    A value greater than or equal to 0 that is the index of the item to retrieve.

Returns

IItemPromise

An IItemPromise that contains the requested IItem. If the item wasn't found, the promise completes with a value of null.

public fromKey(key: string, hints?: any): IItemPromise

Retrieves the item from the IListDataSource that has the specified key and makes it the current item.

Parameters

  • key: string

    The key that identifies the item to retrieve. This value must be a non-empty string.

  • hints?: any optional

    Domain-specific information that provides additional information to the IListDataAdapter to improve retrieval time.

Returns

IItemPromise

An IItemPromise that contains the requested IItem. If they item couldn't be found, the promise completes with a value of null.

public jumpToItem(item: IItem): IItemPromise

Makes the specified IItem or IItemPromise the current item.

Parameters

  • item: IItem

    The IItem or IItemPromise that will become the current item.

Returns

IItemPromise

An IItemPromise that contains the specified item, if it exists. If the specified item is not in the list, the promise completes with a value of null.

public last(): IItemPromise

Retrieves the last item in the IListDataSource and makes it the current item.

Returns

IItemPromise

An IItemPromise that contains the requested IItem. f the list is empty, the promise completes with a value of null.

public next(): IItemPromise

Retrieves the item after the current item and makes it the current item.

Returns

IItemPromise

An IItemPromise that contains the item after the current item. If the cursor moves past the end of the list, the promise completes with a value of null.

public previous(): IItemPromise

Retrieves the item before the current item and makes it the current item.

Returns

IItemPromise

An IItemPromise that contains the item before the current item. If the cursor moves past the start of the list, the promise completes with a value of null.

public release()

Releases resources, stops notifications, and cancels outstanding promises for all tracked items returned by this IListBinding.

public releaseItem(item: IItem)

Creates a request to stop change notifications for the specified item. The change notifications stop when the number of releaseItem calls matches the number of IIItemPromise.retain calls.

Parameters

  • item: IItem

    The IItem or IItemPromise that should stop receiving notifications.