December 2013
Intermediate to advanced
480 pages
14h 11m
English
By default, when you create a WinJS.Binding.List from a JavaScript array, the list is observable but not the items in the list. The WinJS.Binding.List simply contains the items from the array and the items are plain old JavaScript objects.
If you want to convert each of the items from the JavaScript array into an observable item, then you need to use the binding option when creating the WinJS.Binding.List like this:
var products = [ { name: "Milk", price: 2.99 }, { name: "Oranges", price: 2.50 }, { name: "Apples", price: 1.99 }];// Create Listvar productsList = new WinJS.Binding.List(products, { binding: true });// Listen for changes in priceproductsList.getAt(1).bind( ...
Read now
Unlock full access