我正在开发chat application with KO
。虽然binding
聊天对话,浏览器挂起,直到绑定和favicon, browser Refresh
和光标按钮为blinking
为每个消息绑定。将数据绑定到敲除视图时闪烁问题
我试过想制作visible false by default
和制作visible after binding
。但它没有为我工作。
这里是结合消息
ko.utils.arrayForEach(data, function (item) {
var msgobj = new ViewMessagesObject();
msgobj.Chattype(item.Chattype);
msgobj.contactname(item.contactname);
msgobj.contactnum(item.contactnum);
msgobj.contactpic(item.contactpic);
msgobj.deliverydate(item.deliverydate);
msgobj.file(item.file);
msgobj.frompic(item.frompic);
msgobj.is_delivered(item.is_delivered);
msgobj.is_read(item.is_read);
msgobj.loader(item.loader);
msgobj.message(item.message);
msgobj.messageid(item.messageid);
msgobj.messgetype(item.messgetype);
msgobj.Pic(item.Pic);
msgobj.readdate(item.readdate);
msgobj.sentdate(item.sentdate);
msgobj.sentstatus(item.sentstatus);
msgobj.toname(item.toname);
msgobj.topic(item.topic);
msgobj.uploadopacity(item.uploadopacity);
self.DisplayMessageCollection.push(msgobj);
}
如何能同时结合我stop
这些闪烁的问题KO代码。
我附加了一个video
,它显示了favicon和刷新按钮的闪烁,以便您可以清楚地理解我的问题。
在此先感谢..
Video Demonstrating My Problem
是否每个消息属性都需要是可观察的?即如果消息没有改变,你可以只用'self.DisplayMessageCollection。推(项目);' – 7zark7
我们已经试过了,但是,这并不工作:( – RealSteel
我们试图直接推高了每一个项目,pushAll一次,但没有的工作,除了这个:( – RealSteel