Jqgrid multiselect selected rows count?

和自甴很熟 提交于 2019-12-06 04:35:12

You should just get the length of the array selarrrow:

var selRowIds = jQuery('#grid').jqGrid('getGridParam', 'selarrrow');
alert ('The number of selected rows: ' + selRowIds.length);

This works for me: Place a link anywhere you want

<a href="/" id="displayNoSelectedRows">Click me!</a>

and now simply register the callback function

$("#displayNoSelectedRows").click(function() {
    var no = $("input[id^='jqg_gridid_']:checked").length;
    alert(no);
    return false;
});

for this link, where gridid is the table's id. With the knowledge of how the checkboxes are named (or better the way the ids are assigned) this is a possible way to get the number of selected checkboxes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!