Give a class to every button that is used to expand row and then use jQuery trigger
:
<table>
<tr>
<td><button class='expand-row-button'>+</button></td><td>other things</td>
</tr>
<tr>
<td><button class='expand-row-button'>+</button></td><td>other things</td>
</tr>
<tr>
<td><button class='expand-row-button'>+</button></td><td>other things</td>
</tr>
</table>
<button onclick="$('.expand-row-button').trigger('click');">Expand all rows</button>
** EDIT **
Because you are using jqGrid, you should look at expandSubgridRow method. This method is used to expand row with specified id. You can iterate through rows in your view and generate code to expand every row.