简体   繁体   中英

knockout ko.observableArray doesn`t refresh the view

The code can be found here When I'm initializing observableArray and call ko.applyBindings it works well. But any other changes to the view model are not displayed on ui. I'm adding another object to observableArray and knockout doesn't render it in the grid.

When you push to an observableArray, you want to call push directly on the observableArray itself and not just on the underlying array.

So, you would want to call:

Categories.push instead of Categories().push .

observableArrays include wrappers to many of the array functions that will perform the operation on the underlying array and notify any subscribers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM