Simple question, hard to find an answer:
If I try to select a row programmatically, I use this:
$('#grid').jqGrid('setSelection', rowId);
The problem is that it only selects rows on current visible page. If rowId is on another page, it will not be selected.
More info: My goal is to select multiple rows (spread on multiple pages) when page loads for the first time.
Thanks, Rafael
PS: This guy has the same problem. No answer yet: jqgrid multiselect only selects rows on the current page, if paging is enabled. How to make it select rows across pages?
Please see this: https://stackoverflow.com/a/24941828/136219
For a way to achieve what you are looking for.
Right, jqGrid will only select rows on the current page. In order to select other rows you need to maintain a list of selected ID's and manually select them.
To do this you need to add code to your
loadComplete
event to search the current page and select any of these rows:You also need to add code to your
onSelectRow
andonSelectAll
events to adjust the contents ofselected
when the user selects/unselects rows:Does that help?