I'm using Ryan Niemeyer's Dirty Flag.
An example of his method can be seen in this jsFiddle.
He has a dirtyItems method on the ViewModel
this.dirtyItems = ko.computed(function() {
return ko.utils.arrayFilter(this.items(), function(item) {
return item.dirtyFlag.isDirty();
});
}, this);
However, I can't seem to get his dirtyItems method working with my data.The biggest difference is that I am using the mapping plugin.
Everything I have tried comes back empty.
Here is a jsFiddle of my implementation.
You could add the dirtyFlag to the ProfilePropertyValue like:
var mappingOptions = {
ProfilePropertyValue: {
create: function (mappingoptions) {
var data = mappingoptions.data;
data.ProfilePropertyValue = data.ProfilePropertyValue || {
"ID": null,
"Checkbox": ko.observable(false)
};
var result = ko.mapping.fromJS(data);
result.dirtyFlag = ko.dirtyFlag(result);
return result;
}
}
};
Then, you would need to check it when building your list of dirty items, if that is something that you need.
Sample: http://jsfiddle.net/rniemeyer/7DGfs/