Is it possible to modify the (for lack of a better term) schema of an object during the mapping process? I would imagine it is, I just can't seem to get it to work. I'm trying something like this:
var data = {
itemOne: 'someData',
itemTwo: 'moreData'
}
var mapping = {
"newItem": {
create: function(options) {
return ko.observable(false);
}
}
};
ko.mapping.fromJS(data, mapping, _model.observableArrayPart);
Here is a sample that shows customizing how your array is creating and defining a key for it, so that you can apply updates using the mapping plugin: http://jsfiddle.net/rniemeyer/LHeQZ/