지금 당장 요소 열을 가져오고 드래그 한 부분, 복제 한 부분이 있지만 놓으면 원본도 제거됩니다. jQuery UI sortable : 복제본을 이동하지만 원본을 유지합니다.
$(".column").sortable({
helper: 'clone',
connectWith: ".column",
connectWith: ".grid",
start: function(e, ui){
ui.placeholder.height(ui.item.height());
$(".column").find('.portlet:hidden').show()
console.log('started')
},
stop: function(event, ui) {
$(ui.helper).clone(true).removeClass('box ui-draggable ui-draggable-dragging').addClass('box-clone').appendTo('body');
}
});
어떻게 원본을 유지할 수있는 자사의 원하는 위치 및 복제 이동이 (컬럼에 다시 추가없이)?
'clone()'을 사용할 때 유효하지 않은 HTML (중복 ID)을 생성하는 것에주의하십시오. – jbabey
[이 질문] (http://stackoverflow.com/questions/6940390/how-do-i-duplicate-item-when-using-jquery-sortable)은 매우 유사하며 훌륭한 대답을 가지고 있습니다. 승인 된 것이 아닌 하나의 것으로 표기 됨. – Coderer