title: Uncaught TypeError: $(...).jqGrid is not a function on subGridRowExpanded
body: <p>I'm trying to load data into a <code>jqGrid</code> sub grid (subgrid as grid) and get the above error on this line:</p>
  
  <pre><code>$("#" + subgrid_table_id).jqGrid
  </code></pre>
  
  <p>Please help - thanks.</p>
  
  <p>My JS code:</p>
  
  <pre><code>&lt;link rel="stylesheet" href="~/Styles/ui.jqgrid-bootstrap.css" /&gt;
  &lt;link rel="stylesheet" href="~/Styles/ui.jqgrid-bootstrap-ui.css" /&gt;
  
  &lt;script src="/Scripts/jquery-1.9.1.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/JqGrid/jquery.jqGrid.min.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/JqGrid/jquery.jqGrid.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/JqGrid/grid.jqueryui.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/JqGrid/grid.subgrid.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/JqGrid/jqModal.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/JqGrid/i18n/grid.locale-he.js"&gt;&lt;/script&gt;
  
  &lt;div id="jqGrid"&gt;
      &lt;table id="grid" style="float:right; width:100%"&gt;&lt;/table&gt;
      &lt;div id="pager" style="float:right;"&gt;&lt;/div&gt;   
  &lt;/div&gt;
  &lt;script type="text/javascript"&gt;
  
      var gridDataUrl = 'GetAllPurchasesJson';
      var lastSel;
  
      $("#grid").jqGrid({
          url: gridDataUrl,
          datatype: "json",
          mtype: 'POST',
          jsonReader: {
              root: 'gridModel',
              repeatitems: true,
              subgrid: {root:'rows', repeatitems: true, cell:"cell" } 
          }
      ,
  
       colNames: ['Id','סטטוס','סה"כ כולל מע"מ','מע"מ','סה"כ ללא מע"מ','תאריך אספקה','תאריך הזמנה','ספק','מספר הזמנה'],
       colModel: [
  
                    { name: 'Id', index: 'Id', width: 50, align: 'right', hidden: true },
                     {
                         name: 'Status',
                         index: 'סטטוס',
                         width: 100,
                         align: 'right',
                         editable: true,
  
                     },
                    {
                        name: 'Total',
                        index: 'סה"כ כולל מע"מ',
                        width: 100,
                        align: 'right',
  
  
                    },
                          { name: 'Vat', index: 'מע"מ', width: 100, align: 'right' },
                    { name: 'TotalNoVat', index: 'סה"כ ללא מע"מ', width: 100, align: 'right' },
                    { name: 'ArrivedDate', index: 'תאריך אספקה', width: 100, align: 'right', formatter: 'date', formatoptions: { srcformat: 'U', newformat: 'd/m/Y' } },
                    { name: 'OrderDate', index: 'תאריך הזמנה', width: 100, align: 'right', formatter: 'date', formatoptions: { srcformat: 'U', newformat: 'd/m/Y' } },
                    { name: 'Supplier', index: 'ספק', width: 100, align: 'right' },
                    { name: 'OrderNumber', index: 'מספר הזמנה', width: 100, align: 'right' }
  
  
  
  
       ],
      cmTemplate: { editable: false },
       rowNum: 20,
       rowList: [10, 20, 30],
       height: 'auto',
       width: '800',
       pager: jQuery('#pager'),
       sortname: 'Name',
       viewrecords: true,
       sortorder: "desc",
       regional: 'he',
       editurl: '@Url.Action("SaveOrUpdateProduct", "Inventory")',
          subGrid: true,
          subGridRowExpanded: function(subgrid_id, row_id) {
              // we pass two parameters
              // subgrid_id is a id of the div tag created within a table
              // the row_id is the id of the row
              // If we want to pass additional parameters to the url we can use
              // the method getRowData(row_id) - which returns associative array in type name-value
              // here we can easy construct the following
              var subgrid_table_id;
              subgrid_table_id = subgrid_id+"_t";
              $("#"+subgrid_id).html("&lt;table id='"+subgrid_table_id+"' class='scroll'&gt;&lt;/table&gt;");
              $("#" + subgrid_table_id).jqGrid({
                  url:"GetPurchaseDetailes/"+row_id,
                  datatype: "json",
                  colNames: ['Id','Status','ActualTotal','ActualVat','ActualPaid'],
                  colModel: [
                    {name:"Id",index:"Id",width:80,key:true},
                    {name:"Status",index:"Status",width:130},
                    {name:"ActualTotal",index:"ActualTotal",width:80,align:"right"},
                    {name:"ActualVat",index:"ActualVat",width:80,align:"right"},           
                    {name:"ActualPaid",index:"ActualPaid",width:100,align:"right",sortable:false}
                  ],
                  height: '100%',
                  rowNum:20,
                  sortname: 'Id',
                  sortorder: "asc"
              });
          }          });
  </code></pre>