title: Grouping issue with addJSONData
body: <p>I have some issue with jqGrid paging. I want create own group and add row data to it. While I add data to grid on the first page its Ok, but if add new group on the next page, I can see exception in Firebug and empty page. I use addJSONData method. The problem is that addJSONData iterate through all groups in Grid and look for their length:</p>
  
  <pre><code>str += "&lt;tr id=\""+hid+"\" role=\"row\" class= \"ui-widget-content jqgroup ui-row-"+$t.p.direction+"\"&gt;&lt;td colspan=\""+colspans+"\"&gt;"+icon+$.jgrid.format(grp.groupText[0], gv, grdata[n].length)+"&lt;/td&gt;&lt;/tr&gt;"; 
  </code></pre>
  
  <p>But if I have one group on previous page and only sent data of second group with ajax and call addJSONData it throws exception: length of undefined. How can I solve it?</p>
  
  <p><strong>UPDATE:</strong> Here is my code:</p>
  
  <pre><code>function addToGrid(group, ids){
    var rowNum = jQuery(myGrid).jqGrid('getGridParam', 'rowNum');
    data = jQuery.ajax({
      url: myUrl,
      data: {'group': group, 'rowNum': rowNum, 'ids': ids},
      dataType: 'json',
      complete: function(jsondata,stat){
         if(stat=="success") {
            var targetGrid = jQuery(myGrid);
            var myjsongrid = eval('('+jsondata.responseText+')'); 
            var rows = myjsongrid.rows;
            if(rows.length != 0){
                 targetGrid[0].addJSONData(myjsongrid);
            }           
         }
      }
   });
  </code></pre>
  
  <p>}</p>
  
  <p>And table:</p>
  
  <pre><code>$(myGrid).jqGrid({
      url: myUrlTable,
      datatype: 'json',
      postData: {},
      mtype: 'GET',
      jsonReader: { repeatitems : false},
      colNames: ['Id', 'Group', 'Bytes'],
      colModel: [{name:'id', index: 'id', hidden: true},
                 {name:'group', index: 'group', width: 100},
                 {name:'bytes', index: 'bytes', width: 60, classes:'gc column-bytes', sortable: false, sorttype:'int', formatter:'integer'}
                 ],
      grouping: true,
      groupingView: { 
          groupField : ['group'],
          groupText : ['Group: ({1} items)'],
          groupOrder: 'asc',
          groupDataSorted : true
      },
      sortable: true,
      toppager: true,
      hoverrows: true,
      altrows: false,
  });
  </code></pre>
  
  <p>Test data from server:</p>
  
  <pre><code>{"total":1,"page":1,"records":1,"rows":[{"group":"abc", "bytes":229447,"id":"7124"}]}
  </code></pre>
  
  <p>Another records are similar. I added 20 records and then I added next 5 on another page with group bbb.
  Method addToGrid is called from another grid and with ids and entered group name to input dialog. Then I pass it to server and server returns valid data to fulefill grid. Server returns only data for the last page in my case 5 rows.</p>
  
  <p>Server response:</p>
  
  <pre><code> {"total":2,"page":2,"records":5,"rows":[{"group":"bbb", "bytes":229447,"id":"7155"},
                                           {"group":"bbb", "bytes":229447,"id":"7156"},
                                           {"group":"bbb", "bytes":229447,"id":"7157"},
                                           {"group":"bbb", "bytes":229447,"id":"7158"},
                                           {"group":"bbb", "bytes":229447,"id":"7159"}
                                          ]
   }
  </code></pre>