title: TypeError: $(...).jqGrid is not a function on button click to trigger reload
body: <p>My grid loads fine for the first time. But on button click , I need to reload the grid and it gives the error 'TypeError: $(...).jqGrid is not a function'.</p>
  
  <p>This happens both in firefox and chrome.
  Please help.</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" media="screen" href="&lt;%=request.getContextPath()%&gt;/themes/ui.jqgrid.css" /&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen" href="&lt;%= request.getContextPath()%&gt;/themes/jquery-ui-1-10-TW-custom/jquery-ui-1.10.2.custom.css" /&gt;
  &lt;LINK rel=STYLESHEET href="&lt;%= request.getContextPath()%&gt;/themes/jquery-ui-timepicker-addon.css"    rel="stylesheet" type="text/css"&gt;&lt;/LINK&gt;
  
  &lt;script type='text/javascript' src="&lt;%= request.getContextPath()%&gt;/js/i18n/grid.locale-en.js"&gt;&lt;/script&gt;
  &lt;script src="//code.jquery.com/jquery-1.11.1.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"  type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src="&lt;%= request.getContextPath()%&gt;/js/jquery.jqGrid.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src="&lt;%= request.getContextPath()%&gt;/js/plugins/jqModal.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src="&lt;%= request.getContextPath()%&gt;/js/plugins/jquery.tablednd.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" src="&lt;%=request.getContextPath()%&gt;/js/jquery/jquery-ui-timepicker-addon.js" type="text/javascript"&gt;&lt;/script&gt;
  
  
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function()
  {
      $("#gridData").jqGrid({
      url:contextPath + "/psapi/esppPreclearance.do?method=gridData&amp;stockClass="+ $("[name=stockClass]").val()+"&amp;transactionType="+$("[name=transactionType]").val(),
      datatype: "json",
      colNames:['&lt;bean:message key="plansetup.label.stockclass" /&gt;','&lt;bean:message    key="windowPeriod.label.dispTypeCode" /&gt;',
             '&lt;bean:message key="windowPeriod.label.fromDate" /&gt;', '&lt;bean:message key="windowPeriod.label.toDate" /&gt;', '&lt;bean:message key="windowPeriod.label.ParticipantLevel" /&gt;',
          '&lt;bean:message  key="participantBenificiary.label.seqNo" /&gt;',
             '&lt;bean:message   key="windowPeriod.label.product" /&gt;', '&lt;bean:message    key="windowPeriod.label.participantGrp" /&gt;', 
             '&lt;bean:message   key="participantGroup.label.Participant-id" /&gt;','&lt;bean:message  key="common.label.activeStatus" /&gt;'],
           autowidth: true,
      pager: '#pager',
      colModel:[
          {name:'stockClass',index:'stockClass', width:60},
          {name:'transTypeDesc',index:'transTypeDesc', width:90},
          {name:'frmDate',index:'fromDate', width:100, sorttype:"date"},
          {name:'toDate',index:'toDate', width:100, sorttype:"date"},
          {name:'prdLvlDesc',index:'prdLvlDesc', width:80, align:"right",sorttype:"float"},
          {name:'prdSeqNo',index:'prdSeqNo', width:30, align:"right"},        
          {name:'productId',index:'productId', width:80, align:"right",sorttype:"int"},       
          {name:'partGroup',index:'partGroup', width:30, align:"right",},
          {name:'globalId',index:'globalId', width:80, align:"right",},
          {name:'activeFlg',index:'activeFlg', width:50, align:"center    "},
      ],
      loadonce: true,
      multiselect: false,
      rowNum:20,
      viewrecods: true,
      rowlist:[10,20,30,40,50],
      height:463,
  
  
  });
  
  
  
  
  jQuery("#gridData").jqGrid('navGrid','#pager',{add:false,edit:false,del:false});
  
  
  $("[name=btnFind]").click(function()
          {
              $("#gridData").jqGrid("setGridParam", {datatype: "json"}).trigger("reloadGrid");
              alert("I AM OUT");
  
          });
  
  
  
  
  });
  &lt;/script&gt;
  </code></pre>