Hello. I'm trying to make category changes with Jquery & Php. I have no problem with it. My problem is, when the update event is called, it returning 2 results. 1 result for Dragged Parent, One result for Dropped Parent. I wanna call only dropped parent's id. Here is my script:
- $("#gallery ul").sortable({
- connectWith: '.dropBox',
- scroll: true,
- scrollSensitivity: 100,
- helper: 'clone',
- containment:'#gallery',
- accept:'#gallery > .photo',
- revert: true,
- update: function(event, ui){
- var params = 'category=' + $(this).attr('id') + '&id=' + ui.item.attr('id');
- $.ajax({
- type: 'POST',
- url: 'processData.php',
- data: params,
- error:function(){
- alert("Error!");
- },
- success:function(data){
- $("#serverResponse").html(data);
- }
- });
- alert(params);
- }
- }).disableSelection();
Please help...