knockoutjs ObservableArrays and sort function: UI is not updated
问题 In my viewmodel, I have a knockoutjs ObserableArray. Just after I initialized the ViewModel, it binds the data successfully. Then, what I need to do is to sort the collection. $.each(vm.searchResults(), function (i, property) { console.log(property.Name()); }); vm.searchResults().sort(function (a, b) { return a.Name().toLowerCase() > b.Name().toLowerCase() ? 1 : -1; }); $.each(vm.searchResults(), function (i, property) { console.log(property.Name()); }); As you can see, I output the Name of