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.Binding.Template object

Applies to Windows and Windows Phone

Provides a reusable declarative binding element.

Syntax


var object = new WinJS.Binding.Template(element, options);

Members

The Template object has these types of members:

Constructors

The Template object has these constructors.

ConstructorDescription
Template

Creates a template that provides a reusable declarative binding element.

 

Methods

The Template object has these methods.

MethodDescription
render

Binds values from the specified data context to elements that are descendants of the specified root element that have the declarative binding attributes specified (data-win-bind).

render

Renders a template based on the specified URI (static method).

 

Properties

The Template object has these properties.

PropertyAccess typeDescription

bindingInitializer

Read/write

Gets or sets the default binding initializer for the template.

debugBreakOnRender

Read/write

Gets or sets a value that specifies whether a debug break is inserted into the first rendering of each template. This property only has an effect when the app is in debug mode.

disableOptimizedProcessing

Read/write

This property is deprecated and might not be available in future versions of the WinJS. Gets or sets a value that specifies whether optimized template processing has been disabled.

element

Read/write

Gets the DOM element that is used as the template.

extractChild

Read/write

Gets a value that specifies whether templates should be instantiated without the creation of an additional child element.

isDeclarativeControlContainer

Read-only

Determines whether the Template contains declarative controls that must be processed separately. This property is always true. The controls that belong to a Template object's children are instantiated when a Template instance is rendered.

 

Remarks

For more information about using templates with a ListView, see Quickstart: Add a ListView. You can also refer to the HTML ListView essentials sample (Windows). For more information about using templates with a FlipView, see Adding FlipView controls. You can also refer to the HTML FlipView control sample (Windows). For an explanation of how to use these templates with an array, see How to use templates to bind data.

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.Binding

Library

Base.js

 

 

Show:
© 2014 Microsoft