2014-10-26 10 views

回答

1

我看到了您發佈的鏈接。您創建的JSON不適用於TreeTable請讓我指出您在代碼中所犯的一些錯誤。

檢查點:

1. var tData = {"SessionTransactions":{}} //This is not required its unnecessarily declared 

    // Use this directly 
    var tData = { 
      "":{}, 
      "SessionTransactions":{//Some Value} 
    }; 

2. tData = { 
     "": {}, 
     "SessionTransactions": { 
      0: { 
       0: {}, 
       1: {}, 
       2: {}, 
       3: {}, 
       4 :{ //This was missing which leads to the empty row 
        "__metadata": {}, 
        "Service": {}, 
        "Poi": {} 
       } 
      }, 
      1: { 
       0:{} 
      } 
      } 
    }; 
3. The second level child with empty rows is because of "__metadata","Service" and "Poi" 
     0:{ 
     "__metadata": {}, 
     "Service": {}, 
     "Poi": {} 
     } 

改變JSON後立即嘗試。我想這可能對你有幫助

+0

如果解決方案解決您的查詢可以接受的答案(通過選擇綠色對勾),否則如果你有別的東西,你可以問太多。 :) – Roshan 2014-10-30 07:26:29