title: Make jqGrid multiselect selection persist following pagination, toolbar search, or filter
body: <p>I have this <a href="http://jsfiddle.net/david_c/mUMGs/3/" rel="nofollow noreferrer">jqGrid</a>.  The following is my desired behavior:</p>
  
  <ol>
  <li>The selected item will have the selection persist (and be rendered as such to the user) after changing pages or doing a search (toolbar or filter)</li>
  <li><p>When the select all button is selected, if no items on the current page are selected, it selects them all.  If there is an item already selected, it will clear the entire list, whether on the page or not.</p></li>
  <li><p>When the Invoice Print button is clicked, it will either use the list of IDs that has been created as we go, or create a list of all IDS that have been selected, whether in the current display or not.</p></li>
  </ol>
  
  <p>It would be acceptable if filter was not supported, but preferred.</p>
  
  <hr>
  
  <p>To be sure, I know little about js, but here are some things that I have tried with mixed success:</p>
  
  <ol>
  <li><p>This <a href="https://stackoverflow.com/questions/4710780/jqgrid-multiselect-only-selects-rows-on-the-current-page-if-paging-is-enabled">answer</a> suggests to use the onSelectRow and onSelectAll, but I was unable to implement.  <a href="http://jsfiddle.net/david_c/ECtVw/" rel="nofollow noreferrer">see fail</a></p></li>
  <li><p><a href="http://www.trirand.com/blog/?page_id=393/help/maintaining-checkbox-selections-through-a-page-operation/" rel="nofollow noreferrer">This</a> looks promising, but only will fix the pagination thing.  So #1 looks like a prefered route.  <a href="http://pastebin.com/1Yyf07xA" rel="nofollow noreferrer">pastebin for question #2</a></p></li>
  </ol>
  
  <hr>
  
  <p>P.S.  back to the know little about js.  in my project the alert and not shown functionality of the function select_ids does work, not sure why it is not displaying the alert in the jsfiddle.  so sorry in advance that it needs repair, brownie points to however posts the forked fix.</p>
  
  <pre><code>grid.jqGrid({
              datatype: "local",
              data: mydata,
              colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
              colModel:[
                  {name:'id',index:'id', key: true, width:70, sorttype:"int"},
                  {name:'invdate',index:'invdate', width:90, sorttype:"date"},
                  {name:'name',index:'name', width:100},
                  {name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
                  {name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},
                  {name:'total',index:'total', width:80,align:"right",sorttype:"float"},
                  {name:'note',index:'note', width:150, sortable:false}
              ],
              search:true,
              pager:'#pager',
              jsonReader: {cell:""},
              rowNum: 10,
              rowList: [5, 10, 20, 50],
              sortname: 'id',
              sortorder: 'asc',
              viewrecords: true,
              multiSort: true, 
              multiselect: true, 
  
              height: "100%",
              caption: "Invoice Print"
          });
          grid.jqGrid('navGrid','#pager',{add:false,edit:false,del:false,search:true,refresh:true},
                      {},{},{},{multipleSearch:true, multipleGroup:true, showQuery: true});
          grid.jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false, defaultSearch:"cn"});
  </code></pre>