Home

Awesome

THIS PROJECT NEEDS A MAINTAINER.


knockout-sortablejs

A Knockout.js binding to SortableJS.

Demo: http://rubaxa.github.io/Sortable/

Support KnockoutJS

Include knockout-sortable.js

<div data-bind="sortable: {foreach: yourObservableArray, options: {/* sortable options here */}}">
	<!-- optional item template here -->
</div>

<div data-bind="draggable: {foreach: yourObservableArray, options: {/* sortable options here */}}">
	<!-- optional item template here -->
</div>

Using this bindingHandler sorts the observableArray when the user sorts the HTMLElements.

The sortable/draggable bindingHandlers supports the same syntax as Knockouts built in template binding except for the data option, meaning that you could supply the name of a template or specify a separate templateEngine. The difference between the sortable and draggable handlers is that the draggable has the sortable group option set to {pull:'clone',put: false} and the sort option set to false by default (overridable).

Other attributes are:

NPM

npm install knockout-sortablejs