Knockout.js Gotchas
- Knockout's observableArray dependency tracking breaks if you bind with a call to sort,reverse, etc.
- Therefore don't do things like data-bind="foreach items.sort()", you instead bind normally with sortedItems() and then create a computed property sortedItems that sorts items. Be careful though this technique will sort items in place and not just the new computed property sortedItems.
- http://stackoverflow.com/questions/18729643/ko-observablearray-update-breaks-when-binding-with-sort
No comments:
Post a Comment