我想使用 PHP 和 AJAX 为我的网站创建一个菜单编辑器
我创建了 menu.php,它从 MySQL 数据库加载菜单项,通过一个函数解析它们,该函数为菜单项创建代码,然后按顺序显示在 HTML 列表中(告诉我这是否令人困惑,我可以发布代码)。我想做的是一个管理页面,允许用户对菜单项重新排序,顺便说一句,它们是按顺序列排序的。
提前致谢:)
编辑:我遇到的主要问题是创建用户界面,用户可以在其中移动菜单项(希望是拖放),然后将新订单保存到数据库中。
I created menu.php which loads the menu items from a MySQL database, parses them through a function which creates the code for the menu items which are then displayed in order in an HTML list (tell me if this is confusing and I can post the code). What I would like to make is an admin page the would allow the user to reorder the menu items, BTW they are sorted by an order column.
thanks in advance :)
edit: The main part where I'm stuck is creating the user interface where the user can shift the menu items around (hopefully drag and drop) and then saving the new order to the database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这就是您正在寻找的:
http://www.hdeya.com/blog/2009/05/sorting-items-on-the-fly-ajax-using-jquery-ui-sortable-php -mysql/
它使用jquery可排序插件。
I think this is what you are searching for :
http://www.hdeya.com/blog/2009/05/sorting-items-on-the-fly-ajax-using-jquery-ui-sortable-php-mysql/
It uses the jquery sortable plugin.
我将从 jQuery UI 可排序小部件开始:
http://jqueryui.com/demos/sortable/
I would start out with the jQuery UI sortable widget:
http://jqueryui.com/demos/sortable/