다음을 통해 공유


WinJS.UI.Repeater object

Generates HTML from a set of data. Use this control to generate lists of items.

Syntax

<div 
    data-win-control="WinJS.UI.Repeater">
</div>
var object = new WinJS.UI.Repeater();

Members

The Repeater object has these types of members:

  • Constructors
  • Events
  • Methods
  • Properties

Constructors

The Repeater object has these constructors.

Constructor Description
Repeater

Creates a new Repeater control.

 

Events

The Repeater object has these events.

Event Description
onitemchanged

Raised after an item in the Repeater control's data source changes and after the corresponding DOM element has been updated.

onitemchanging

Raised after an item in the Repeater control's data source changes but before the corresponding DOM element has been updated.

oniteminserted

Raised after an item has been added to the Repeater control's data source and after the corresponding DOM element has been added.

oniteminserting

Raised after an item has been added to the Repeater control's data source but before the corresponding DOM element has been added.

onitemmoved

Raised after an item has been moved from one index to another in the Repeater control's data source and after the corresponding DOM element has been moved.

onitemmoving

Raised after an item has been moved from one index to another in the Repeater control's data source but before the corresponding DOM element has been moved.

onitemremoved

Raised after an item has been removed from the Repeater control's data source and after the corresponding DOM element has been removed.

onitemremoving

Raised after an item has been removed from the Repeater control's data source but before the corresponding DOM element has been removed.

onitemsloaded

Raised when the Repeater has finished loading a new set of data. This event is only fired on construction. This event is only raised when the Repeater is constructed or its data source or template changes.

onitemsreloaded

Raised after the Repeater control's underlying data has been updated and after the updated HTML has been reloaded.

onitemsreloading

Raised after the Repeater control's underlying data has been updated but before the updated HTML has been reloaded.

 

Methods

The Repeater object has these methods.

Method Description
addEventListener

Registers an event handler for the specified event.

dispatchEvent

Raises an event of the specified type and with additional properties.

dispose

Releases resources held by this Repeater. Call this method when the Repeater is no longer needed. After calling this method, the Repeater becomes unusable.

elementFromIndex

Returns the HTML element for the item at the specified index.

removeEventListener

Removes an event handler that the addEventListener method registered.

 

Properties

The Repeater object has these properties.

Property Access type Description

data

Read/write

Gets or sets the List that provides the Repeater with items to display.

element

Read-only

Gets the DOM element that hosts the Repeater.

length

Read-only

Gets the number of items in the Repeater control.

template

Read/write

Gets or sets a WinJS.Binding.Template or custom rendering function that defines the HTML of each item within the Repeater.

 

Remarks

The WinJS Repeater control only supports synchronous item templates. Consider another component such as List if asynchronous support is needed.

Requirements

Minimum WinJS version

WinJS 2.0

Namespace

WinJS.UI