Jqgrid multiselect limit?
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.
精彩评论