Knockout custom binding for jQuery UI Sortable - strange behavior

后端 未结 2 1086
春和景丽
春和景丽 2021-02-06 05:24

I\'m using jQuery Sortable and Knockout to maintain an array.

http://jsfiddle.net/daniel_white/KrGY8/3/

Notice when you drag the items, they duplicate or disappe

2条回答
  •  长发绾君心
    2021-02-06 06:04

    An easy way to work around this problem is to first clear your binded observableArray, like this:

    list([]);
    

    Then updated it with the correct array:

    list(actualArray);
    

    Check the updated fiddle

提交回复
热议问题