I have a demo application in which I have an array where all elements are observables. In this app I have a function that simulates a call from a server - getting the same array that is bound to the list, but with one item changed. This is the way I have implemented it:
aArray is the simulation of data fetched from the server where an unknown random item has changed and I am binding it to the list with ko.mapping. The problem is that this way the whole list gets rerendered, instead of only updating the one item. I still want all the elements of the array to be observables after the rebinding as well as before rebinding. Is there any way to fix this - to make Knockout understand it only has to update one item? |
this.allItems()
[Math.floor((Math.random() * 10) + 0)].name(Math.floor(Math.random() * 2000 + 1000));
--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
this.allItems(responseFromWorker);
--
this.allItems()
[Math.floor((Math.random() * 10) + 0)].name(Math.floor(Math.random() * 2000 + 1000));
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.