The issue is related to the mapping configuration within Schedule. The mapping call ko.mapping.fromJS(data, { scheduleDays : scheduleDayMapping }, self) instructs the utility to only customize the mapping of the scheduleDays object from the data variable.
Since that configuration doesn't include an entry for unallocatedHolder, the mapping utility uses the default observable creation behavior instead of the custom behavior. The UnallocatedHolder function is never called, so its purchases array doesn't get the custom mapping. Without that mapping, integrationStatus is not defined for those purchases.
I'd suggest defining a new mapping configuration for Schedule like this:
var scheduleMapping = {
"scheduleDays": scheduleDayMapping,
"unallocatedHolder": {
create: function(options) {
return new UnallocatedHolder(options.data);
}
}
};
Then, reference this new mapping configuration within Schedule by updating the mapping line to
ko.mapping.fromJS(data, scheduleMapping, self);
Revised Fiddle
viewModelobject to view, so should it not besomeVariableNameThatHoldsPurchaceObject.integrationStatus?Array1,table2, foo, bar are rather confusing and will lead to us making assumptions about your code as @Rajesh is making in the above comment. How are you using theforeachbinding? How are you "moving" from one array to the other? It would really easy to help you if you can create a minimal fiddle or a working snippet.