I noticed in the jqgrid demo (http://www.trirand.com/blog/jqgrid/jqgrid.html > Advanced > Multiselect) that only rows (visible) on the current page are selected if paging is enabled.
Any tips on getting it to work across multiple pages. Or any other alternative solutions?
I'm assuming you would like to do select some rows in one page, then go to another page, maybe select some more rows, and have all of those selection persisted.
You will have to handle the selection events on each check box. Attach an event handler to
each $("#cb_my_grid")
and persist an array of selected items. Then when you need the data (maybe when the page is submitted) you can submit the values in the array.I know this question is kind of dusty, but I recently had a need for this functionality and found what I consider a much more clean way to do it.
Instead of attaching an event to each checkbox, why not use the
onSelectRow
andonSelectAll
events of the jqGrid? When a row is selected, check if our list of selected rows includes this row (based on id). Add it to the list if it was not there and has been selected, remove it if it was there and is no longer selected. If all rows are selected, iterate through them.Hope this helps others looking for a solution.