I'm working with sortable today and a little stuck.
I'm trying to get the new parent's ID to use in an ajax request.
EDIT: I have it logging the parent now but it's just adding the same parent ID in the array for all of them.
$('.portlet-row').sortable({
connectWith: ".portlet-row",
update: function(e, ui) {
var imageids_arr = [];
var listids_arr = [];
$('.portlet').each(function(){
var id = $(this).attr('id');
var split_id = id.split("_");
imageids_arr.push(split_id[1]);
var ids = $(e.target).attr('id');
var split_ids = ids.split("_");
listids_arr.push(split_ids[1]);
});
$.ajax({
url: 'sorts.php',
type: 'post',
data: {imageids:imageids_arr, listids: listids_arr},
success: function(response){ }
});
}
});
$('.portlet-row').disableSelection();