title: JqGrid: Only able to retrieve selected id of current page
body: <p>I have a Jqgrid with <code>multiselect =true</code> option along with the paging . My page size is 10 and during editing if there are more record then the page size it goes onto 2 page . This is working fine . </p>
  
  <p>My query is if i am on current page and directly save the data without going to the nextpage then my array only 10 record and that data is saved other record are deleted.</p>
  
  <p>Kindly help me to rectified the issue</p>
  
  <p>Here is my code</p>
  
  <pre><code>    $("#WorkerMigrationSearchGrid").jqGrid({
      datatype: '',
      height: 340,
      width: 910,
      colNames: ['WorkerID', 'Worker Name', 'IC / FIN', 'WP No', 'BusinessUnitID', 'PrimarySubContractorID', 'Status', 'PrimaryTradeID'],
      colModel: [
      { name: 'WorkerID', index: 'WorkerAttendanceID', width: 1, hidden: true },
      { name: 'Worker', index: 'Worker', width: 200, sortable: false },
      { name: 'IdentificationNumber', index: 'IdentificationNumber', width: 50, sortable: false },
      { name: 'WPNumber', index: 'WPNumber', width: 50, sortable: false },
      { name: 'BusinessUnitID', index: 'ScanTime', width: 90, sortable: false, hidden: true },
      { name: 'PrimarySubContractorID', index: 'ScanType', width: 30, sortable: false, hidden: true },
      { name: 'Status', index: 'Status', width: 1, hidden: true },
      { name: 'PrimaryTradeID', index: 'PrimaryTradeID', width: 1, hidden: true }
  ],
      multiselect: true,
      caption: "Select Worker",
      pager: jQuery('#pager'),
      viewrecords: true,
      scrollrows: true,
      shrinkToFit: true,
      rowNum: 10,
      rowList: [10, 15, 20],        // disable page size dropdown
      pgbuttons: true,
      pgtext: "Page {0} of {1}",
      altRows: true,
      onSelectAll: function (rowid, isSelected) {
          idsOfSelectedRows = [];
  
          if (isSelected) {
  
              var i, count, id
              for (i = 0, count = rowid.length; i &lt; count; i++) {
                  id = rowid[i];
                  updateIdsOfSelectedRows(id, isSelected);
  
              }
  
          }
          //idsOfSelectedRows.push(id);
      },
      onSelectRow: function (id, isSelected) {
          updateIdsOfSelectedRows(id, isSelected);
      },
      gridComplete: function () {
          var i, selCount;
          for (i = 0, selCount = idsOfSelectedRows.length; i &lt; selCount; i++) {
  
              row = $("#WorkerMigrationSearchGrid").getRowData(idsOfSelectedRows[i])
  
              if (row["WorkerID"] != undefined) {
  
                  jQuery("#WorkerMigrationSearchGrid").jqGrid('setSelection', row["WorkerID"]);
  
              }
  
          }
  
      },
      onPaging: function (pgButton) {
          SearchWorker();
      }
  });
  
  var updateIdsOfSelectedRows = function (id, isSelected) {
      var p = $("#WorkerMigrationSearchGrid").p, item = $("#WorkerMigrationSearchGrid").getRowData(id);
      item.cb = isSelected;
      i = $.inArray(id, idsOfSelectedRows);
      if (!isSelected &amp;&amp; i &gt;= 0) {
  
          idsOfSelectedRows.splice(i, 1); // remove id from the list
  
      } else if (i &lt; 0) {
  
          idsOfSelectedRows.push(id);
  
      }
  }
  </code></pre>