Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
On click of LoadData button i am loading jqgrid data but at first time i click the button it does not load and display nothing here is my code

PHP
var $JqtblAuditQuestions = $("#JqtblAuditQuestions");


$JqtblAuditQuestions.jqGrid({
      colNames:AuditcolNames,
      colModel:AuditcolModel,
      viewrecords: true,
      gridview: true,
      altRows:true,
      altclass:'myAltRowClass',
      sortable: true,
      loadtext: "Loading...",
      emptyrecords: "No records to view",
      width: '100%',
      height:'100%',
      ondblClickRow: function(rowId) {
          tblAuditQuestionsLeftDoubleClick(rowId)
      }
  });


PHP
$JqtblAuditQuestions.jqGrid('clearGridData');
   $JqtblAuditQuestions.jqGrid('setGridParam',
   {
       datatype: "local",
       data: tdata,
       rowNum: 50
   }).trigger("reloadGrid");

<<div id="tblAuditQuestions"  style="width: 100%; height: 100%;">
            <span id="JqtblAuditQuestionsEmpty" class="TrebuFont10" style="display: none">Questions
                do not exist.</span>
            <table id="JqtblAuditQuestions" style="width: 100%; height: 100%; vertical-align: middle;
                background-color: #869ca7;">
            </table>
     </div>


any help would be great for me.
Posted
Updated 21-Nov-13 0:43am
v3
Comments
ZurdoDev 21-Nov-13 7:47am    
Debug it and see what is happening.
[no name] 21-Nov-13 8:05am    
Hey RyanDev i did some changes and now error is diffrent here is new code

$JqtblAuditQuestions.jqGrid({
datatype: "local",
data: tdata,
colNames:AuditcolNames,
colModel:AuditcolModel,
viewrecords: true,
gridview: true,
altRows:true,
altclass:'myAltRowClass',
sortable: true,
loadtext: "Loading...",
emptyrecords: "No records to view",
width: '100%',
height:'100%',
ondblClickRow: function(rowId) {
tblAuditQuestionsLeftDoubleClick(rowId)
}
}).trigger("reloadGrid");

Now it is loading at first click but not loading on second click but when i go while debuging it loads and display the data.

1 solution

Hi I am also facing the same issue.. :(
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900