A drag and drop binding for Knockout
npm install knockout-dragdropA drag and drop binding for Knockout.
npm install knockout-dragdrop
bower install knockout-dragdrop
Dragging between two lists:
``htmlDrag from here
`js
var model = {
source: ko.observableArray([
'Declan',
'Tessa',
'Claire',
'Violet',
'Alice',
'Mia',
'Camille',
'Aiden'
]),
target: ko.observableArray(),
drop: function (data, model) {
model.source.remove(data);
model.target.push(data);
}
};
ko.applyBindings(model);
`Running the example locally
Run the following command:
`
npm install && bower install && serve
`and open http://localhost:3000 in your browser.
License
Knockout.dragdrop is licensed under a standard 3-clause BSD license -- see the
LICENSE`-file for details.