如何在 ASPNET MVC 中制作具有重新排列功能的复选框?
我有一个要求,需要在 ASPNET MVC 中具有重新排列功能的复选框。
主要目的是了解用户选择了哪个复选框,并允许他们根据需要重新排列复选框项目顺序。
我的问题是,mvc(或jquery)中是否有类似的现有控件?如果没有,是否有更好的 UI 控件来实现我的目的?
我发现类似的问题没有合适的答案。 带有复选框的列表框
我请求您的回复。谢谢。
I've got a requirement that needs a checkbox with rearranging capability in ASPNET MVC.
The main purpose is to know which checkbox users selected and allow them to rearrange the checkbox item order as they want.
My Question is, do there any existing control like this available in mvc(or jquery)? If no, do there any better UI control to fulfill my purpose?
I found the similar question with no appropriate answer.
listbox with checkboxes
I beg for your response. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不在 jQuery-UI Sortable< 中使用普通复选框 /strong>?
然后申请
您可以轻松转换
具有剃刀语法的复选框 5
:为了持久化,您需要做的就是按照正确的顺序编写 HTML,让我们想象一下您有这个表:
您需要做的就是:
您将始终将复选框正确排序开始,保存后您需要做的就是循环遍历所有复选框并更新新的
Order
值。why don't you use the normal checkbox with the jQuery-UI Sortable?
and then apply
You can easily convert the
<input id="chb-5" type="checkbox" value="5"/> Checkbox 5
with the razor syntax:for persistence all you need to do is write the HTML is the correct order, let's image you have this table:
all you need to do is:
You will always have the checkboxes sorted correctly on start, upon save all you need to do is loop through all checkboxes and update the new
Order
value.