From 6928b193ab9d571c78a34550e71b9c4712f9dae6 Mon Sep 17 00:00:00 2001 From: Sebastian Rosengren Date: Wed, 4 Mar 2015 21:35:34 +0100 Subject: [PATCH] Added KnockoutJS description to README --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 1c1867d..0e949de 100644 --- a/README.md +++ b/README.md @@ -387,6 +387,32 @@ React.render(
--- + +### Support KnockoutJS +Include [knockout-sortable.js](knockout-sortable.js) + +```html +
+ +
+ +
+ +
+``` + +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](http://knockoutjs.com/documentation/template-binding.html) 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: +* options: an object that contains settings for the underlaying sortable, ie `group`,`handle`, events etc. +* collection: if your `foreach` array is a computed then you would supply the underlaying observableArray that you would like to sort here. + + +--- + + ### Method