1

次の Object があるとします。

var gridViewModelJs = 
    {"GridViewModel":{"Rows":[{"RowNumber":"1","Id":"6","Name":"FullNameOfUser","NumberOfUsers":"12","RegistrationDate":"10/15/2013"}],"FoundItems":"4","CurrentPage":1,"TotalPages":1,"ItemsPerPage":50,"PagingLinks":""}, 
    "EntityModel":{"Id":0,"PermissionIds":null,"Name":null,"NumberOfUsers":0,"PersianRegistrationDate":null,"RegistrationDate":"0001-01-01T00:00:00","Authorizations":null,"Users":null,"Contents":null}};
var KoEntityViewModel = ko.mapping.fromJS(gridViewModelJs);
ko.applyBindings(KoEntityViewModel);

上記のコードは機能します。更新にはKoEntityViewModel.、次のコードを使用しました。

// receivedData is data that returns from jQuery Ajax
// I'm dead sure `receivedData` is correct
var doneFunc = function (receivedData) {
    ko.mapping.fromJS(receivedData, KoEntityViewModel.EntityModel);
    showDetailsBlock();
};

しかし、何も更新されませんKoEntityViewModel.EntityModelKoEntityViewModel.EntityModel上記のサンプルを更新する方法を教えてください

4

1 に答える 1