Hello I am working on a JQuery nested sortable lists, I came across a plugin for nested sorting here I can drag and drop the list items successfully but I want to have an ajax call once an item in the list is dragged, Is it possible to this with this plugin ? Does it provide any option to call ajax after the drag is complete?
My JS file is
$('#sortable').nestedSortable(
{
disableNesting: 'no-nest',
forcePlaceholderSize: true,
handle: 'div',
items: 'li',
opacity: .6,
placeholder: 'placeholder',
revert: 250,
tabSize: 25,
tolerance: 'pointer',
toleranceElement: '> div',
connectWith: '.sortable',
onChange: function(serialized) {
},
onStop : function(){
var element_id = $(this).attr("id");
var parent_id = $(this).parent().attr("id");
var prev_sibling_id = $(this).prev().attr("id");
if(parent_id=='trash'){
var url = $(this).attr("patent-trash");
var data = {PID:element_id};
$.ajax({
type: "POST",
data: data,
url:url,
cache: false,
success: function(data) {
document.location.reload(true);
}
});
}
});
I used onStop before which worked but there were some issues, I think the plugin is same but some updates are done 1 month ago, Is it now giving any option for calling ajax after the drag is complete or is there any alternative way to do it?
Please help me I tried all my efforts
Thanks in advance