2011-06-21 25 views
0

我一直在努力獲取數據以顯示在jqgrid中。然後網格顯示正常,但沒有數據,我不知道爲什麼數據丟失。這是從網頁的響應我試圖加載問題獲取jqgrid在c#webform上顯示數據

{total: "1",page: "1",records: "2",rows : [{id:"1", "cell":["Test1", "1234", "Info"]},{id:"2", "cell":["Test2", "5678", "Info"]}]} 

這是加載在信息代碼:

<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" /> 
<link rel="stylesheet" type="text/css" media="screen" href="css/jquery-ui-1.7.2.custom.css" /> 

<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script> 
<script src="Scripts/grid.locale-en.js" type="text/javascript"></script> 
<script src="Scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script> 
<script src="Scripts/jquery.jqGrid.min.js" type="text/javascript"></script> 
<script src="Scripts/json2-min.js" type="text/javascript"></script> 

<script type="text/javascript"> 

//JS for the main history grid 
jQuery(document).ready(function() { 
    jQuery("#datalist").jqGrid({ 
     url: 'Data1.aspx', 
     datatype: 'json', 
     colNames: [ 
       'Type' 
      , 'URN' 
      , 'Log'], 
     colModel: [{ name: 'id', index: 'id', sorttype: "int", width: 35 }, 
     { name: 'type', index: 'type', width: 45, align: "center" },   
     { name: 'log', index: 'log', width: 35, align: "center"}], 
     height: 400, 
     width: 1165,   
     shrinkToFit: true, 
     caption: "Job History", 
     viewrecords: true, 
     sortorder: "desc"    
    })  
}); 

I我的JSON響應的格式錯了,我是否缺少來自我的網格的東西?現在真的開始糾纏我了!

感謝 盧克

+0

忘記這個缺失報價一輪的鑰匙,我剛剛發現了這個問題。我錯過了總/頁/記錄中的引號! – beakersoft

回答