I have some very basic binding .. working.
Now I am trying to delete a row. It is not working.
I am not passing the correct
var ClientModel = function () {
this.clients = ko.observableArray(data); // Load json data
self.del = function(elem) {
if (confirm('Delete: ' + elem.Name)) {
this.client.remove(elem);
};
}
}
I am not sure why the remove is not working.
The functions for selection and deletion are in the parent view model, so you should call them with
$parent.selectand$parent.del.Also this line had some mistakes:
Here is the fixed jsfiddle.