I got these two ko.computeds lists that I want to drag and drop among, but also moved with pushbuttons to remove an add to lists.
However I cannot make them work with both the dragndrop and the pushbutton functionality.
For the drag and drop I use Ryan Niemeyers excellent sortable library.
I guess I need to make my computeds writable, but this is where I get stuck and can´t seem to get rid of the error "splice is not a function" for the computed.
Hence the sorting by drag and drops fails.
This is one of the computers:
this.availableTexts = ko.computed({
read: function(){
return ko.utils.arrayFilter(self.texts(), function(text) {
return text.sceneID() === null;
})
},
write: function(value){
return value;
},
owner: this
});
Full fiddle: http://jsfiddle.net/AsleG/yLvrp7zz/