2017-07-11 224 views
0

我實現劍道樹列表,但我得到了一些問題如下:最大調用堆棧大小

RangeError: Maximum call stack size exceeded
at init._defaultParentId

代碼:

var bindingData = [{ "RateTypeID": 1, "c": null, "Type": "abc", "based": "xyz" }, 
        { "RateTypeID": 1, "c": 1, "Type": "pqr", "based": "xyz" }, 
        { "RateTypeID": 3, "c": 1, "Type": "mno", "based": "xyz" }]; 
var dataSource = new kendo.data.TreeListDataSource({ 
        data: bindingData, 
        schema: { 
         model: { 
          id: "RateTypeID", 
          parentId:"c", 
          fields: { 
           RateTypeID: { field: "RateTypeID", type: "number", editable: false, nullable: false }, 
           c: { field: "c", nullable: true }, 
           Type: { type: "string" }, 
           basedon: { type: "string" }, 
          } 
         } 
        } 
       }); 
+0

檢查你提到你需要'Type'或基於on' – SwapNeil

+0

喜'UnitType' /'based'或'什麼列名.. @ swapnilnax,我想這樣做,但不工作得到同樣的錯誤 –

回答

1

最後我是分析我的數據和我得到的解決方案如下:

在以下數據一直是問題,因爲RateTypeID屬性使用作爲父母如此相同和複製v在這個領域找到alues它會給出錯誤Maximum call stack size exceeded

var bindingData = [{ "RateTypeID": 1, "childto": null, "UnitType": "abc af f ", "basedon": "xyz" }, 
       { "RateTypeID": 1, "childto": 1, "UnitType": "pqr adf asd", "basedon": "dsaf" }, 
       { "RateTypeID": 2, "childto": 1, "UnitType": "mno asfsd sd ", "basedon": "xyasdfz" }]; 

Parent fields value must be unique for tree List in kendo.

相關問題