What is the best way to make a serialized jQuery sort result in a database?

I use the JQuery.Sortable () function to create a reorderable list of such items

 <script type="text/javascript">
    // When the document is ready set up our sortable with it inherant function(s)
    $(document).ready(function() {
        $("#goal-list").sortable({
            handle: '.handle',
            placeholder: 'ui-state-highlight',
            update: function() {
                var order = $('#goal-list').sortable('serialize');
                $("#info").load("/goals/process?" + order);
            }
        });
    });
</script>

The returned result is a comma-delimited list of the element identifier (i.e. 1,2,3,4,5,6, etc.)

What I want to know is the best way to fix this in the sort column of a table of related items ... I could scroll and update each record, but I think that there are a lot of records in the database and it could be a potential bottleneck, especially if the list is quite large.

I am using LINQ-to-SQL and ASP.NET MVC

+3
source share
1

, LINQ to SQL. . .

. db, db SaveChanges SubmitChanges.

... SaveChanges , ​​ db .

+3

Source: https://habr.com/ru/post/1703634/


All Articles