开发者

Saving Ordering Of A Sortable List Using jQuery UI

I am currently working on a wordpress function which allows users to add links to the side bar of their website (and automatically generates the domain extension based on the users input). I am currently trying to implement jQuery UI's sortable function to allow users to order their links the way they like. The sortable function is working great, however the order will not save once the page is refreshed. 开发者_开发问答I have looked everywhere and it seems that I should be using ajax and some type of update function within the jQuery.

right now I have this:

$(document).ready(function(){
$("tbody#existing").sortable({
helper: fixHelper}).disableSelection();

});


Yes, you need to communicate the item order back to the server and that probably means AJAX. Once the server has this info then it needs to store it someplace (the database), then later it needs to retrieve it, and finally do something useful with it. This puts you squarely in the middle of "plugin development."

There is (at least) one plugin that does something like this, My Link Order. You could use that, or use it as a learning tool to develop your own plugin.

Some other pages that may be useful to you:

  • Writing a Plugin
  • Creating Options Pages
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜