是否有一个jQuery List插件可以自动对项目进行排序并具有可靠的添加/删除方法? [英] Is there a jquery List plugin that will auto-sort items and has robust add/remove methods?

查看:63
本文介绍了是否有一个jQuery List插件可以自动对项目进行排序并具有可靠的添加/删除方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜寻了好几个小时,寻找可以解决我情况的东西.我不够熟练,无法编写自己的jquery插件..YET !!

I have been googling for hours looking for something to handle my situation. I am not skilled enough to write my own jquery plugin ..YET!!

该插件应自动对列表进行排序,而不像能够轻松地从列表中添加/删除项目那样重要.具备Themeroller能力的人将是一个加分.

The plugin should auto-sort the list, not as important as being able to add/remove items from the list easily. Themeroller capable would be a plus.

我基本上会使用任何东西,只要我可以将一个项目添加到列表中(或其他任何容器),该项目就来自使用ajax搜索该项目的模式弹出窗口.找到该项目后,我想单击该项目并将其添加到列表中,并将根据字母排序将其置于正确的顺序.我认为我所看不见的是该项目的复杂性,需要将该项目包含在其中:

I would basically use anything as long as I could add a item to the list (or any other container for that matter), item is coming from a modal popup that is using ajax to search for the item. Once the item is found I want to click that item and have it added to the list and it would put it into the correct order based on alphabetic sort. I think where I am losing sight is the complexity of the item and needing to have the item contain:

  1. 商品名称
  2. 一个隐藏值[项目的int ID]
  3. 一个或两个复选框,用于打开/关闭该项目的功能.

我真的很乐意接受任何想法,更好的过程的建议,或者可能会使我与之接近的插件的指针.

I am really open to any ideas, suggestions on a better process, or a pointer to a plugin that might get me close.

推荐答案

我使用了 jQuery.TinySort 整理各种东西.它应该可以与您物品中的任何物品一起使用. 我不明白为什么您绝对需要插件来处理添加到<ul>并自动排序的问题.只需编写一个简单的函数$("#myList").append(myNewItem),然后使用$("#myList").tsort()调用列表的重新排序即可(根据需要进行排序).

I've used jQuery.TinySort to sort all sorts of things. It should work with whatever you have in your item. I don't see why you absolutely need the plugin to handle adding to the <ul> and auto-sort. Just write a simple function that $("#myList").append(myNewItem) and then call a re-sort of the list with $("#myList").tsort() (refined to what you need to sort).

这篇关于是否有一个jQuery List插件可以自动对项目进行排序并具有可靠的添加/删除方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆