現在直面している問題があります。オブジェクトのリストを含む監視可能な配列があります。配列のオブジェクトのプロパティを更新するたびに、ブラウザに反映されません。replace、removeなどのすべてのノックアウト関数を使用しています。更新は監視可能な配列で行われますが、ブラウザでは行われません。
これが私の問題のサンプルです:
var ViewModel=new {
self=this;
self.List=ko.observableArray([]);
}
$(function(){
ko.applyBinding(ViewModel);
})
$.post('/url',{},function(data){
ViewModel.List(data); //data is list having 4 property having CommentList as again object-->id,title,description,CommentList--->commenttitle,commentdescription
})
//During change of property of commentList
$.post('/updateComment',{},function(obj){//Here obj-->obj.Commenttitle="some title",obj.commentdescription='some description'
//Let say there require update 4th object of List and 2nd property of CommentList
ViewModel.AnswerList()[4].CommentList.splice(2,1,obj);
})
//But nothing updation on browser