2013-07-12 101 views
0

我有很多困難讓kendoGrid綁定到ASPX頁面中的web方法的JSON數據。我一直得到無限的微調。 JSON來自ajax調用。我不知道爲什麼它不綁定到電網。這是我的JS。劍道網格不加載數據webforms

$('#grid').kendoGrid({ 
    columns: [ 
      { 
       field: "ClientName", 
       title: "ClientName" 

      }], 
    dataSource: { 
     type: 'json', 
     serverPaging: true, 
     schema: { 
      data: 'd' 
     }, 
     transport: { 
      read: function (options) { 
       $.ajax({ 
        type: 'POST', 
        url: 'ServiceMonitoring.aspx/GetGridInformation', 
        dataType: 'json', 
        data: '', 
        contentType: 'application/json; charset=utf-8', 
        serverPaging: true, 
        success: function (msg) { 
         options.success(msg.d); 
        } 
       }); 
      } 

     } 
    }, 
    height: 200, 
    pageSize: 10 


}); 
+0

嘗試打開「ServiceMonitoring.aspx/GetGridInformation」頁面並檢查服務器是否正在返回數據。如果是,請檢查格式是否是預期的。順便說一句:爲什麼你使用AJAX來加載內容,而不只是提供網址? – OnaBai

回答

0

我KNW這對你有點晚,但試圖利用

數據:JSON.parse(d)

希望這將幫助其他人誰面臨這個問題。

謝謝。