knockout-sortable
knockout-sortable copied to clipboard
"items" sortable binding not refreshing on sort
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.