Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WinJS.UI.computeDataSourceGroups function

Applies to Windows and Windows Phone

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: IListDataSource

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 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.UI

Library

Ui.js

 

 

Show:
© 2014 Microsoft