Search
ObservableCollection.add Method
See Also
 






Adds an item to the collection.

Namespace: MindFusion.Common.Collections
File: ObservableCollection.js

 Syntax

JavaScript  Copy Code

function add (item)

 Parameters

item

Object. The item to add.

 Example

The following code creates a new List, which derives from ObservableCollection and adds several items to it:

JavaScript  Copy Code

JavaScript  Copy Code 
var product1 = new Object();
product1.title = "Ford";
product1.price = 25345;

var product2 = new Object();
product1.title = "BMW";
product1.price = 75300;
......
.....

List products = new List();
products.add(product1);
products.add(product2);

 See Also