Search
ObservableCollection.remove Method
See Also
 






Deletes an item from the collection.

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

 Syntax

JavaScript  Copy Code

function remove (item)

 Parameters

item

Object. The item to remove.

 Example

The following code creates a List with products. Then it adds several products to it and checks if a product called productX is present and if yes - removes it. List derives from ObservableCollection.

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);


List products = new List([product1, product2, ...]);
.....
.....

if(products.contains(productX))
   products.remove(productX);

 See Also