title: How to get all ID's of jqgrid including the paginated ones?
body: <p>I'm a newbie to JQuery.</p>
  
  <p>I'm trying to use the function listed <a href="https://stackoverflow.com/questions/2188762/php-jqgrid-export-to-excel">here</a>. </p>
  
  <p>The  <code>mya=$("#list").getDataIDs();  // Get All IDs</code> is listing the IDs that are only in the current view. However my grid is paginated one. How can I fetch all the IDs?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$(document).ready(function () {
  
      jQuery("#customer_list").jqGrid({
        url:'jq_customer_list',
        datatype: "json",
        colNames:['Col1','Col2','Col3'],
        colModel:[
  {name:'Col1',index:'Col1', width:100},
  {name:'Col2',index:'Col2', width:80},
  {name:'Col3',index:'Col3', width:75},
       ],
       rowNum:20,
       rowList:[5,10,20],
       mtype:"GET",
       rownumber:true,
       rownumWidth:40,
       pager: $("#customer_list_pager"),
       viewrecords: true,
       gridview: true,
       caption:"My Data",
       height: '50%',
       pagination:true
  
      }).navGrid('#customer_list_pager', { search:true, del: false, add: false, edit: false,searchtext:"Search" },
                 {}, // default settings for edit
                 {}, // default settings for add
                 {}, // delete
                 {closeOnEscape: true, multipleSearch: true, 
                       closeAfterSearch: true }, // search options
                 {}
               ).navButtonAdd('#customer_list_pager',{
                   caption:"Export to Excel", 
                   buttonicon:"ui-icon-save", 
                   onClickButton: function(){ 
                     exportExcel($(this));
                   }, 
                   position:"last"
               });
  
      function exportExcel($id){
          alert('excelExport');
            var keys=[], ii=0, rows="";
            var ids=$id.getRowData();  // Get All IDs
            var row=$id.getRowData(ids[0]);     // Get First row to get the labels
            for (var k in row) {
              keys[ii++]=k;    // capture col names
              rows=rows+k+"\t";     // output each Column as tab delimited
            }
            rows=rows+"\n";   // Output header with end of line
            for(i=0;i&lt;ids.length;i++) {
              row=$id.getRowData(ids[i]); // get each row
              for(j=0;j&lt;keys.length;j++) rows=rows+row[keys[j]]+"\t"; // output each Row as tab delimited
              rows=rows+"\n";  // output each row with end of line
            }
            rows=rows+"\n";  // end of line at the end
            var form = "&lt;form name='csvexportform' action='excelExport' method='post'&gt;";
            form = form + "&lt;input type='hidden' name='csvBuffer' value='"+rows+"'&gt;";
            form = form + "&lt;/form&gt;&lt;script&gt;document.csvexportform.submit();&lt;/sc"+"ript&gt;";
            OpenWindow=window.open('', '');
            OpenWindow.document.write(form);
            OpenWindow.document.close();
          }
  
      $("#customer_list").filterToolbar({autosearch:true });
  
      });
  </code></pre>