There is a property in the grid that should do this for you, according to the API .
multiboxonly
This option only works if the multiselect parameter is set to true. If multiselect is set to true, clicking anywhere in the line selects that line; when multiboxonly is also set to true, a multi-segment is only executed when a button is clicked (Yahoo style). Clicking on any other row (suppose the checkbox is not clicked) deselects all rows and selects the current row.
However, you do not need your beforeSelectRow
function:
jQuery("#grid").jqGrid({ . . . multiselect: true, multiboxonly: true . . . });
source share