QueryCollection.template method

This topic has not yet been rated - Rate this topic

Renders a template that is bound to the given data and parented to the elements included in the QueryCollection. If the QueryCollection contains multiple elements, the template is rendered multiple times, once at each element in the QueryCollection per item of data passed.

Syntax


var queryCollection = queryCollection.template(templateElement, data, renderDonePromiseCallback);

Parameters

templateElement

Type: DOMElement

The DOM element to which the template control is attached.

data

Type: Object

The data to render. If the data is an array (or any other object that has a forEach method) then the template is rendered multiple times, once for each item in the collection.

renderDonePromiseCallback

Type: Function

If supplied, this function is called each time the template gets rendered, and is passed a promise that is fulfilled when the template rendering is complete.

Return value

Type: QueryCollection

The QueryCollection.

Requirements

Namespace

WinJS.Utilities

Library

Base.js

See also

QueryCollection

 

 

Build date: 12/5/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.