December 2013
Intermediate to advanced
480 pages
14h 11m
English
If you need the ability to delete an item from a data source then you need to implement the remove() method. The key of the item being removed is passed to the method and the method returns nothing if the item is removed.
Here’s some sample code that removes an item from an array:
remove: function (key) { var i = this._getIndexFromKey(key); this._arrayData.splice(i, 1); return WinJS.Promise.wrap(null);},_getIndexFromKey:function(key) { for (var i = 0; i < this._arrayData.length; i++) { if (this._arrayData[i].key == key) { return i; } }}
Read now
Unlock full access