我正在研究一些教程。 我一直在四处寻找,似乎无法击中头部。 到目前为止,这是我的代码。
指数
<?php $result = mysql_query("SELECT MAX(listid) AS listid FROM testtable"); while($row = mysql_fetch_array($result)) { for ($i=1; $i List <li class="ui-state-default" id="recordsArray_">
使用Javascript
$(document).ready(function(){ $(function () { $(".sortable").sortable({ connectWith: ".connectedSortable", distance: 5, zIndex: 0, opacity: 0.6, cursor: 'move', update: function() { var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; $.post("updateDB.php", order)} }).disableSelection(); }); });
和updateDB.php代码
现在一切似乎都很好。 但我想要实现的是当我将列表项移动到连接列表时,更新数据库以反映新列表中的项位置。 目前它只是在其原始列表中更新其位置。
我对这一切都很陌生,所以任何帮助都会很棒! 提前致谢。
我的表看起来像这样:
+----------+----------+---------+--------+ | linkname | linkid | posid | listid | +----------+----------+---------+--------+ | 1 | 1 | 2 | 1 | | 1 | 2 | 1 | 1 | | 1 | 3 | 1 | 2 | | 1 | 4 | 2 | 2 | +----------+----------+---------+--------+
以上就是jQuery教程分享使用Mysql更新已连接的可排序列表相关内容,想了解更多jQuery开发(异常处理)及jQuery教程关注计算机技术网(www.ctvol.com)!)。
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/jquerytutorial/547707.html