Interface IListDataAdapter

Accesses data for an IListDataSource.

Index

Properties

Methods

Properties

public compareByIdentity: boolean

Gets or sets a value that specifies whether to use an object's identity to determine if an item has changed.

Methods

public change(key: string, newData: T in WinJS.UI.IListDataAdapter<T>, indexHint: number): Promise

Overwrites the data of the specified item.

Parameters

  • key: string

    The key of the item to overwrite.

  • newData: T in WinJS.UI.IListDataAdapter<T>

    The new data for the item.

  • indexHint: number

    The index of the item, if known.

Returns

Promise

A Promise that returns null or undefined when the operation completes.

public getCount(): Promise

Gets the number of items in the IListDataAdapter object's data source.

Returns

Promise

A Promise that contains the number of items the IListDataAdapter contains, or an approximate value if the actual number is unknown.

public insertAfter(key: string, data: T in WinJS.UI.IListDataAdapter<T>, previousKey: string, previousIndexHint: number): Promise

Inserts the specified data after the specified item.

Parameters

  • key: string

    A key that can be used to retrieve the new data.

  • data: T in WinJS.UI.IListDataAdapter<T>

    The new data to add to the IListDataAdapter object's data source.

  • previousKey: string

    The key of an item in the IListDataAdapter object's data source. The new data will be inserted after this item.

  • previousIndexHint: number

    The index of the item to insert the new data after, if known.

Returns

Promise

A Promise that contains the IItem that was added or an EditError if an error was encountered.

public insertAtEnd(key: string, data: T in WinJS.UI.IListDataAdapter<T>): Promise

Adds the specified key and data to the end of the IListDataAdapter object's data source.

Parameters

  • key: string

    A key that can be used to retrieve the new data.

  • data: T in WinJS.UI.IListDataAdapter<T>

    The new data to add to the IListDataAdapter object's data source.

Returns

Promise

A Promise that contains the IItem that was added or an EditError if an error was encountered.

public insertAtStart(key: string, data: T in WinJS.UI.IListDataAdapter<T>): Promise

Adds the specified key and data to the beginning of the IListDataAdapter object's data source.

Parameters

  • key: string

    A key that can be used to retrieve the new data.

  • data: T in WinJS.UI.IListDataAdapter<T>

    The new data to add to the IListDataAdapter object's data source.

Returns

Promise

A Promise that contains the IItem that was added or an EditError if an error was encountered.

public insertBefore(key: string, data: T in WinJS.UI.IListDataAdapter<T>, nextKey: string, nextIndexHint: number): Promise

Inserts the specified data before the specified item.

Parameters

  • key: string

    A key that can be used to retrieve the new data.

  • data: T in WinJS.UI.IListDataAdapter<T>

    The new data to add to the IListDataAdapter object's data source.

  • nextKey: string

    The key of an item in the IListDataAdapter object's data source. The new data will be inserted before this item.

  • nextIndexHint: number

    The index of the item to insert the new data before, if known.

Returns

Promise

A Promise that contains the IItem that was added or an EditError if an error was encountered.

public itemSignature(item: IItem): string

Returns a string representation of the specified item that can be used for comparisons.

Parameters

  • item: IItem

    The item for which to generate a signature.

Returns

string

The signature representation of the specified item.

public itemsFromDescription(description: string, countBefore: number, countAfter: number): Promise

Retrieves the item that matches the specified description and also retrieves the specified number of items before and after the matched item.

Parameters

  • description: string

    A description of the item to locate.

  • countBefore: number

    The number of items before the matched item to retrieve.

  • countAfter: number

    The number of items after the matched item to retrieve.

Returns

Promise

A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered.

public itemsFromEnd(count: number): Promise

Retrieves the specified number of items from the end of the IListDataAdapter object's data source.

Parameters

  • count: number

    The number of items to retrieve.

Returns

Promise

A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered.

public itemsFromIndex(index: number, countBefore: number, countAfter: number): Promise

Retrieves the item at the specified index and also retrieves the specified number of items before and after the selected item.

Parameters

  • index: number

    The index of the item to retrieve.

  • countBefore: number

    The number of items to retrieve from before the selected item.

  • countAfter: number

    The number of items to retrieve from after the selected item.

Returns

Promise

A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered.

public itemsFromKey(key: string, countBefore: number, countAfter: number): Promise

Retrieves the item that has the specified key and also retrieves the specified number of items before and after the selected item.

Parameters

  • key: string

    The key of the item to retrieve.

  • countBefore: number

    The number of items to retrieve from before the selected item.

  • countAfter: number

    The number of items to retrieve from after the selected item.

Returns

Promise

A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered.

public itemsFromStart(count: number): Promise

Retrieves the specified number of items from the beginning of the IListDataAdapter object's data source.

Parameters

  • count: number

    The number of items to retrieve.

Returns

Promise

A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered.

public moveAfter(key: string, previousKey: any, indexHint: string, previousIndexHint: number): Promise

Moves the specified item to just after another item.

Parameters

  • key: string

    A key of the item to move.

  • previousKey: any

    The key of another item. The item to move will be moved to just after this item.

  • indexHint: string

    The index of the item to move, if known.

  • previousIndexHint: number

    The index to move the item after, if known.

Returns

Promise

A Promise that contains the IItem that was added or an EditError if an error was encountered.

public moveBefore(key: string, nextKey: any, indexHint: string, nextIndexHint: number): Promise

Moves the specified item to just before another item.

Parameters

  • key: string

    A key of the item to move.

  • nextKey: any

    The key of another item. The item to move will be moved to just before this item.

  • indexHint: string

    The index of the item to move, if known.

  • nextIndexHint: number

    The index to move the item before, if known.

Returns

Promise

A Promise that contains the IItem that was added or an EditError if an error was encountered.

public moveToEnd(key: string, indexHint: number): Promise

Moves the specified item to the end of the IListDataAdapter object's data source.

Parameters

  • key: string

    The key for the item to move.

  • indexHint: number

    The index of the item to move, if known.

Returns

Promise

A Promise that contains the IItem that was added or an EditError if an error was encountered.

public moveToStart(key: string, indexHint: number): Promise

Moves the specified item to the beginning of the IListDataAdapter object's data source.

Parameters

  • key: string

    The key for the item to move.

  • indexHint: number

    The index of the item to move, if known.

Returns

Promise

A Promise that contains the IItem that was added or an EditError if an error was encountered.

public remove(key: string, data: T in WinJS.UI.IListDataAdapter<T>, indexHint: number): Promise

Removes the specified item from the IListDataAdapter object's data source.

Parameters

  • key: string

    The key of the item to remove.

  • data: T in WinJS.UI.IListDataAdapter<T>

    The new data for the item.

  • indexHint: number

    The index of the item.

Returns

Promise

A Promise that returns null or undefined when the operation completes.

public setNotificationHandler(notificationHandler: IListDataNotificationHandler)

Registers a notification handler. The IListDataAdapter uses the handler to notify listening objects when its data changes.

Parameters

  • notificationHandler: IListDataNotificationHandler

    The notification handler that the IListDataAdapter will use to provide change notifications. .