Having trouble with knockout js. But seems to me it's a bug. Maybe there are some workaround.
There is an example of sorting list here and it works. And there is another example and it doesn't. The only difference between them is version of KO.
Any help would be appreciated.
Update: I don't know the reason but after calling splice method KO refreshes binding in some incorrect way. So the workaround I've found - force rebind array model.
The code I use to force rebinding is follows:
// newArray is ko.observableArray([...])
var original = newArray();
newArray([]);
newArray(original); // KO will rebind this array
Is there more elegant way to force rebinding?