knockout-sortable icon indicating copy to clipboard operation
knockout-sortable copied to clipboard

"items" sortable binding not refreshing on sort

Open birds-inc opened this issue 10 years ago • 0 comments

Migrating our sortable interface and encountered this issue.

We use the .disabled class on our li's to make them not-selectable - this class is dynamically applied over the life of the list.

sortable: {
    data: list.listItems,
    options: {
        items: 'li:not(.disabled)'
    }

Sortable was able to handle this just fine. However, with knockout-sortable I have to use the cancel binding instead:

sortable: {
    data: list.listItems,
    options: {
        items: 'li',
        cancel: '.disabled',
    }

Calling .sortable("toArray") shows the list has been correctly updated, but knockout-sortable is preventing from the draggable behavior from being removed from the disabled items.

birds-inc avatar Aug 08 '14 17:08 birds-inc