Closed craigpotter closed 6 years ago
Has anyone had this issue before?
It seems to happen when I move items around a lot ... then trigger an ajax call.
function saveMenu(){ var deferredObject = $.Deferred(); var saveBtns = $(".saveMenu"); saveBtns.prop("disabled", "disabled").html('<i class="fa fa-floppy-o" aria-hidden="true"></i> Saving'); var arraied = $('ol.sortable').nestedSortable('toHierarchy', {startDepthCount: 0}); $.each(arraied, function(key,value){ delete value['nestedSortable-item']; }) $.ajax({ type: "POST", url: "ajax/url", data: {data:arraied}, // ISSUE SEEMS TO HAPPEN HERE success: function(result) { deferredObject.resolve(); }, fail: function(){ deferredObject.reject(); } }); var saveBtns = $(".saveMenu"); saveBtns.prop("disabled", false).html('<i class="fa fa-floppy-o" aria-hidden="true"></i> Save'); return deferredObject.promise(); }
The issue seems to happen at this line data: {data:arraied} and the AJAX call never gets called.
data: {data:arraied}
This only seems to happen if I move items around first however.
Any ideas ?
I found my issue.
Looks like nestedSortable-item object was being attached to all items.
Manually removed these and it seems to work now.
Has anyone had this issue before?
It seems to happen when I move items around a lot ... then trigger an ajax call.
The issue seems to happen at this line
data: {data:arraied}
and the AJAX call never gets called.This only seems to happen if I move items around first however.
Any ideas ?