An open API service indexing awesome lists of open source software.

https://github.com/one-com/knockout-dragdrop

A drag and drop binding for Knockout.
https://github.com/one-com/knockout-dragdrop

Last synced: about 1 month ago
JSON representation

A drag and drop binding for Knockout.

Awesome Lists containing this project

README

        

# knockout-dragdrop

A drag and drop binding for Knockout.

[Click here to see an example](http://one-com.github.io/knockout-dragdrop/examples/)

## Install

### NPM

`npm install knockout-dragdrop`

### Bower

`bower install knockout-dragdrop`

## Usage

Dragging between two lists:

```html

Drag from here




Drop 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](http://localhost:3000) in your browser.

## License

Knockout.dragdrop is licensed under a standard 3-clause BSD license -- see the `LICENSE`-file for details.