Jqgrid多选限制?
是否有办法为多选行设置配额?我的意思是我该怎么做:
If multiselectedrows count > 5
alert ("You Can't Select More Than 5 Rows");
我已经检查了手册,但没有选项可以做到这一点。我是 Js/JQuery 的新手,所以我不知道如何计算选定的行数。
Is there anyway to set quota to multiselect rows? I mean how i can do :
If multiselectedrows count > 5
alert ("You Can't Select More Than 5 Rows");
I'm already checked the manual but there is no option to do this. I'm a newbie on Js/JQuery, so i don't know how to count selected rows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在行将被选择 beforeSelectRow< /a> 将被调用。您可以检查当前选定的行数(请参阅此处)并当前要选择的行是否尚未在 selarrrow (如 var selRowIds = jQuery('#grid').jqGrid('getGridParam', 'selarrrow'); if ($.inArray(rowid, selRowIds) < ; 0))。在这种情况下,您可以向用户显示一条消息,然后通过从您的 beforeSelectRow 事件处理程序。
Before the row will be selected the beforeSelectRow will be called. You can examine the number of currently selected rows (see here) and whether the row which will be selecting currently are not already in the selarrrow (like
var selRowIds = jQuery('#grid').jqGrid('getGridParam', 'selarrrow'); if ($.inArray(rowid, selRowIds) < 0)
). In the case you can display a message to the user and then prevent row selection by returningfalse
from your beforeSelectRow event handler.