1
다른 목록이 있는데 목록에서 다른 목록으로 요소를 드래그 할 수 있습니다.이 중 하나를 직렬화하면 각 요소를 가져옵니다. 다른 목록. 정렬 할 수없는 목록에서 요소를 드래그 전용 목록으로 드래그 할 때 문제가 발생하지만 드래그 전용 목록에서 요소를 드래그 할 때 문제가 발생합니다. sortable-list 중 하나를 직렬화하려고 할 때 draggable-list에서 ID를 가져올 수 없습니다.jquery로 다른 listi에서 드래그, 정렬 및 직렬화
예를 들어 이걸 어떻게 직렬화 할 수 있습니까? http://jqueryui.com/demos/draggable/#sortable 시도 할 경우 끌어온 요소가 직렬화되지 않습니다. 대신
var $list = $('#sortable').sortable('serialize');
의
<script>
$(function() {
$("#sortable").sortable({
revert: true
});
$("#draggable").draggable({
connectToSortable: "#sortable",
helper: "clone",
revert: "invalid"
});
$("ul, li").disableSelection();
$('#save').click(function() {
var $list = $('#sortable').sortable('serialize');
alert($list);
});
});
</script>
<div id="save">salva</div>
<div class="demo">
<ul id="draggable">
<li class="ui-state-highlight" id="c_0">Drag me down</li>
</ul>
<ul id="sortable">
<li class="ui-state-default" id="c_1">Item 1</li>
<li class="ui-state-default" id="c_2">Item 2</li>
</ul>
</div><!-- End demo -->
... 시도 ...하지만 당신 ... 나는 그것이 작동하지 않는 이유를 모르겠어요. 그것이 다른 목록의 '자녀'가되는 것과 같이 끌리는 것 같아서 문제가되고 있습니다. 죄송합니다. – MarkyMark