Jquery sortable

Posted by Nishima on Stack Overflow See other posts from Stack Overflow or by Nishima
Published on 2009-08-29T06:53:41Z Indexed on 2010/04/26 22:13 UTC
Read the original article Hit count: 256

Filed under:
|
function dropMembers()
{

    $("ul.present").sortable({
		connectWith: 'ul',
        containment: 'window'
        //containment: 'ADD_MEMBER_DIALOG'
//            sort: function(event, ui) {
//                var present_result=$("ul.present").sortable('toArray');
//               // alert(ui.sortable);
//            }

	});

	$("ul.usrlist").sortable({
		connectWith: 'ul',
		dropOnEmpty: true,
        containment: 'window'
//             sort: function(event, ui) {
//             var usr_result=$("ul.usr").sortable('toArray');
//             //alert(ui.sortable);
//            }
	});

	$("#USER_PRESENT_LIST, #MAIN_USER_LIST").disableSelection();

}

Hi All, The function given above does sorting between two list but if a move an element from one list over the other and drop it outside the window then what happens is the element that i dragged gets appeneded in the other list at the place from where i moved it. Can anyone tell me how can i stop it from appeneding in the other list and if i try to do the same thing as mentioned above then it should get back to the same list from where it was dragged. Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about sortable