From b51d272c8c652f8ed7c98e3d461dcfe4a06657ac Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Wed, 16 Dec 2015 16:18:47 -0500 Subject: Corrected movable/sortble table row handling --- src/usr/local/www/pkg.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/usr/local/www/pkg.php b/src/usr/local/www/pkg.php index 0737b0c..3f3b84b 100755 --- a/src/usr/local/www/pkg.php +++ b/src/usr/local/www/pkg.php @@ -214,9 +214,8 @@ events.push(function() { - jQuery(document).ready(function() { - jQuery('#mainarea table tbody').sortable({ - items: 'tr.sortable', + $('#mainarea table tbody').sortable({ + items: 'tr.sortable', cursor: 'move', distance: 10, opacity: 0.8, @@ -227,24 +226,25 @@ events.push(function() { return ui; }, }); - }); + + function save_changes_to_xml(xml) { - var ids=jQuery('#mainarea table tbody').sortable('serialize', {key:"ids[]"}); + var ids = $('#mainarea table tbody').sortable('serialize', {key:"ids[]"}); var strloading=""; if (confirm("")) { - jQuery.ajax({ + $.ajax({ type: 'get', cache: false, url: "", data: {xml:'', act:'update', ids: ids}, beforeSend: function() { - jQuery('#savemsg').empty().html(strloading); + $('#savemsg').empty().html(strloading); }, error: function(data) { - jQuery('#savemsg').empty().html('Error:' + data); + $('#savemsg').empty().html('Error:' + data); }, success: function(data) { - jQuery('#savemsg').empty().html(data); + $('#savemsg').empty().html(data); } }); } @@ -317,8 +317,9 @@ if ($savemsg) { } } ?> - - +
+
+ +
- + + \n"; // Pairs with an echo tr some way above // Handle pagination and display_maximum_rows -- cgit v1.1