Using updateFromJS is replacing values when it should be adding them
问题 I have this code: var attachmentsModel = { convAttachments: ko.mapping.fromJS([]) }; $(function() { ko.applyBindings(attachmentsModel) refreshConvAttachments(); }); function refreshConvAttachments() { $.ajax({ url: '/xxxxxxx/', success: function (dataJS) { // Send KO the data ko.mapping.updateFromJS(attachmentsModel.convAttachments, dataJS); } }); } The AJAX call above returns: [{ "title": "BillGates", "added_by": "xxx", "thumb": "urlhere", "id": 410, "link": "/link/410", "added_on": "2011-02