开发者

Prevent drag helper from being added to sortable List using knockout [closed]

开发者 https://www.devze.com 2023-03-31 19:02 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.

Closed 9 years ago.

Improve this question

Issue

When dragging an item from the toolbar to an observation group the item is correctly added, but the drag helper is also added to the sortable list.

Desir开发者_Go百科ed Functionality

Drag an element from the toolbar onto an observation group. Depending on what type of observation it is, display the correct template for input.

http://jsfiddle.net/PQL9T/2/


In your sortableList binding, looks like you want to remove the item at the end, since you will be rendering an item based on what you push to your collection.

            //Add Item to list

            collection.splice(newIndex, 0, collectionItem);

            valueAccessor().valueHasMutated();   

            ui.item.remove();  //add this line
0

精彩评论

暂无评论...
验证码 换一张
取 消