computeDataSourceGroups function
TOC
Réduire la table des matières
Développer la table des matières

WinJS.UI.computeDataSourceGroups function

[This documentation is preliminary and is subject to change.]

Applies to: Metro style apps only

Returns a new IListDataSource that adds group information to the items of another IListDataSource.

Syntax

var iListDataSource = WinJS.UI.computeDataSourceGroups(listDataSource, groupKey, groupData, options);

Parameters

listDataSource

Type: IListDataSource

The data source for the individual items to group.

groupKey

Type: Function

A callback function that accepts a single argument: an item in the IListDataSource. The function is called for each item in the list and must return the group key for that item as a string.

groupData

Type: Function

A callback function that accepts a single argument: an item in the IListDataSource. The function is called on one IListDataSource item for each group and must return an object that represents the header of that group.

options [optional]

Type: Object

An object that can contain properties that specify additional options:

groupCountEstimate

A Number value that is the initial estimate for the initial number of groups. If -1 is specified, no result will be returned until the actual number of groups has been determined.

batchSize

A Number greater than 0 that specifies the number of items to be fetched during each processing pass when searching for groups. In addition to the number specified, one item from the previous batch will always be included.

Return value

Type: Object

An IListDataSource that contains the items in the original data source and provides additional group information in the form of a "groups" property. The "groups" property returns another IListDataSource that enumerates the different groups in the list.

Requirements

Minimum supported client

Windows 8 Consumer Preview

Minimum supported server

Windows Server 8 Beta

Namespace

WinJS.UI

Library

Ui.js

 

 

Build date: 2/10/2012

Ajouts de la communauté

AJOUTER
Afficher:
© 2017 Microsoft