开发者

Jqgrid multiselect limit?

开发者 https://www.devze.com 2023-03-30 16:46 出处:网络
Is there anyway to set quota to multiselect rows? I mean how i can do : If multiselectedrows count > 5

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.


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 returning false from your beforeSelectRow event handler.

0

精彩评论

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

关注公众号