0

First all i'm not familiar of jquery, if it's a noob question forgive me. I have a web app and trying to use jQuery sortable function to drag drop data table to change order_id on mysql via php.

If i use jquery 1.11.1 and jquery ui 1.10.3 my function doesn't send data to my php file.

But if i use jquery 1.3.2 and jquery ui 1.7.2 my function send data and it gives following success message on console:

XHR finished loading: GET"http://localhost/.../ArticlesSort.php?listItem[]=2&listItem[]…tItem[]=4&listItem[]=5&listItem[]=6&listItem[]=7&listItem[]=8&listItem[]=9"

My jquery function looks like

jQuery(document).ready(function() { 
    $("#test-list").sortable({ 
        handle : '.handle', 
        update : function () { 
            var order = $('#test-list').sortable('serialize'); 
            $("#info").load("ArticlesSort.php?"+order); 
        } 
    }); 
});

What am i missing? Any help will greatly appricated.

HddnTHA
  • 1,041
  • 3
  • 19
  • 38

1 Answers1

1

I found an answer on jQuery UI Sortable, then write order into a database question's related answer. And it worked. I'm pasting my final code here if someone will have same issue to find solution easily:

$("#test-list").sortable({ 
        handle : '.handle', 
        update : function () { 
            var order = $('#test-list').sortable('serialize'); 
            $.ajax({
                data: order,
                type: 'GET',
                url: 'ArticlesSort.php?'+order,
            });
        } 
});
Community
  • 1
  • 1
HddnTHA
  • 1,041
  • 3
  • 19
  • 38