title: 'loadComplete' event on jqGrid doesn't work if a function is called directly. If we wrap it in anonymous function it works fine
body: <p>If I use this:</p>
  
  <pre><code>loadComplete: rowCount() 
  </code></pre>
  
  <p>it's not working.<br>
  I want to know reason why it is not working if we call directly.</p>
  
  <p>Code Snippet:</p>
  
  <pre><code>function rowCount() {
      var recCount = $("#fbDetailTable").jqGrid('getGridParam', 'records');
      if (recCount == 0) {
          displayMessage("Freight bill not found");
      } else {
          displayMessage("Freight bill found");
      }
  }
  
  function getFreightBill() {
      var frtBill = document.getElementById("freightBill").value;
      if (isNaN(frtBill)) {
          displayMessage("Freight bill contain digits alone");
      } else {
          var intTemplate = {
              sorttype: "integer",
              formatter: "text",
              align: "center"
          };
          var dateTemplate = {
              sorttype: "date",
              formatter: "date",
              align: "center"
          };
          $("#fbDetailTable").jqGrid('GridUnload');
          $("#fbDetailTable").jqGrid({
              url: "/BSNReportBatch/rs/FBService/getFB?fB=" + frtBill,
              datatype: "json",
              colNames: ["Store Number", "Order Number", "SKU number",
                  "Shipped Quantity", "Order Created Date"],
              colModel: [{
                  name: "strNbr",
                  template: intTemplate
              }, {
                  name: "orderNbr",
                  template: intTemplate
              }, {
                  name: "skuNbr",
                  template: intTemplate
              }, {
                  name: "shpdQty",
                  template: intTemplate
              }, {
                  name: "ordCrtDt",
                  template: dateTemplate
              }],
              cmTemplate: {
                  width: 180
              },
              jsonReader: {
                  repeatitems: false,
                  id: "strNbr",
                  root: function (obj) {
                      return obj;
                  }
              },
              pager: "#fbPager",
              rowNum: 50,
              rowList: [50, 100, 200],
              sortName: "strNbr",
              sortOrder: "desc",
              gridview: true,
              autoencode: true,
              height: "auto",
              viewrecords: true,
              loadonce: true,
              caption: "Order Details",
              loadComplete: function () {
                  rowCount();
              }
          });
      }
  }
  </code></pre>