Hi,
I'm trying to use the sortable widget for my site. I have a mini scheduling app that I'd like to display a list of appointments for the week sorted by days.
For this example we'll use only two days ( 2 lists ). If I wanted to drag an appointment (list item) from day 2 over to day 1, is there a way I can callback the id of list 1 after I dragged an item to it? I can find the id of the parent list upon page load but I can't seem to be able to pull the new id after sort. Is this even possible?
<script type="text/javascript">
$(function() {
$("#day1, #day2").sortable({
connectWith: '.sortable'
}).disableSelection();
});
</script>
====
Ok here's what I have so far but i can't seem to get the items being dragged to stick to the list their being dragges to:
<script type="text/javascript">
$(document).ready(function() {
$("#sortable1, #sortable2").sortable().disableSelection();
$("ul:first h3").droppable({
accept: ".connectedSortable li",
hoverClass: "ui-state-hover",
drop: function(ev, ui) {
var $item = $(this);
var $list = $($item.find('a').attr('href')).find('.connectedSortable');
$(this).appendTo($list);
}
});
});
</script>