rniemeyer/knockout-sortable — Issue #5: Sortable gets initialised too early
Author: RoyJacobs
Created: 2012-02-21 15:28:50+00:00
State: open

`$(element).sortable` is called before the template contents get a chance to bind. This is problematic when a sortable option is specified. For instance, if I only want to sort items that have a 'valid' class I specify options like this: `options: { items: 'li.valid }`. If I apply this `valid` class to my list elements using a `data-bind`, this class is not applied when `sortable` is called.

This can be trivially fixed by wrapping the call to `sortable` in a `Clock.setTimeout(func, 0);` but maybe there's a more elegant fix.