Condividi tramite


WinJS.UI.IListDataAdapter interface

Accesses data for an IListDataSource.

Members

The IListDataAdapter interface has these types of members:

  • Methods
  • Properties

Methods

The IListDataAdapter interface has these methods.

Method Description
change

Overwrites the data of the specified item.

getCount

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

insertAfter

Inserts the specified data after the specified item.

insertAtEnd

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

insertAtStart

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

insertBefore

Inserts the specified data before the specified item.

itemsFromDescription

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

itemsFromEnd

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

itemsFromIndex

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

itemsFromKey

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

itemsFromStart

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

itemSignature

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

moveAfter

Moves the specified item to just after another item.

moveBefore

Moves the specified item to just before another item.

moveToEnd

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

moveToStart

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

remove

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

setNotificationHandler

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

 

Properties

The IListDataAdapter interface has these properties.

Property Access type Description

compareByIdentity

Read/write

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

 

Remarks

Implement IListDataAdapter when Binding.List and StorageDataSource don't meet your needs and you want data virtualization.

Implementing IListDataAdapter

To support read access, you must implement the following methods:

Ways to support write access

To support write access, you must support notifications. Then, when you modify the underlying data source to which your IListDataAdapter connects, you use the notification system to provide info about the modification.

Optionally, you also support some additional write access APIs. (These APIs will only ever be called by your own code; they aren't used by the Windows Library for JavaScript.)

Supporting notifications

To provide change notifications, implement the setNotificationHandler method.

Supporting the write access APIs (optional)

To support basic asynchronous write access, you can implement the following methods:

To provide additional write-access features, you can also implement the following methods:

Requirements

Minimum WinJS version

WinJS 3.0

Namespace

WinJS.UI