List object

WinJS.Binding.List object

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

Applies to: Metro style apps only

Creates a WinJS.Binding.List object.

Syntax


var object = new WinJS.Binding.List();

Members

The List object has these types of members:

Methods

The List object has these methods.

MethodDescription
addEventListener

Adds an event listener.

concat

Returns a new list consisting of a combination of two arrays.

createFiltered

Creates a live filtered projection over this list. As the list changes, the filtered projection reacts to those changes and may also change.

createGrouped

Creates a live grouped projection over this list. As the list changes, the grouped projection reacts to those changes and may also change. The grouped projection sorts all the elements of the list to be in group-contiguous order. The grouped projection also contains a .groups property, which is a List representing the groups that were found in the list.

createSorted

Creates a live sorted projection over this list. As the list changes, the sorted projection reacts to those changes and may also change.

every

Checks whether the specified callback function returns true for all elements in a list.

filter

TBD

forEach

Calls the specified callback function for each element in a list.

getAt

Gets the value at the specified index.

getItem

Gets a key/data pair for the specified list index.

getItemFromKey

Gets a key/data pair for the list item key specified.

indexOf

Gets the index of the first occurrence of the specified value in a list.

indexOfKey

Gets the index of the first occurrence of a key in a list.

join

Returns a string consisting of all the elements of a list separated by the specified separator string.

lastIndexOf

Gets the index of the last occurrence of the specified value in a list.

List(list, options)

Creates a List object.

map

Calls the specified callback function on each element of a list, and returns an array that contains the results.

move

Moves the value at index to the specified position.

notifyMutated

Forces the list to send a itemmutated notification to any listeners for the value at the specified index.

notifyReload

Forces the list to send a reload notification to any listeners.

pop

Removes the last element from a list and returns it.

push

Appends new element(s) to a list, and returns the new length of the list.

reduce

Accumulates a single result by calling the specified callback function for all elements in a list. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

reduceRight

Accumulates a single result by calling the specified callback function for all elements in a list, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

removeEventListener

Removes an event listener.

reverse

Returns a list with the elements reversed. This method reverses the elements of a list object in place. It does not create a new list object during execution.

setAt

Replaces the value at the specified index with a new value.

shift

Removes the first element from a list and returns it.

slice

Extracts a section of a list and returns a new list.

some

Checks whether the specified callback function returns true for any element of a list.

sort

Returns a list with the elements sorted. This method sorts the elements of a list object in place. It does not create a new list object during execution.

splice

Removes elements from a list and, if necessary, inserts new elements in their place, returning the deleted elements.

unshift

Appends new element(s) to a list, and returns the new length of the list.

 

Properties

The List object has these properties.

PropertyDescription

groups

Gets a List, which is a projection of the groups that were identified in this list.

length

Gets or sets the length of the list, which is an integer value one higher than the highest element defined in the list.

 

Requirements

Namespace

WinJS.Binding

Library

Base.js

 

 

Build date: 2/10/2012

Ajouts de la communauté

AJOUTER
Afficher:
© 2017 Microsoft