kendo 树列表中超出了最大调用堆栈大小
Maximum call stack size exceeded in kendo Tree List
我实现了 kendo 树列表,但我遇到了如下问题:
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" },
}
}
}
});
最后我分析了我的数据,得到了如下解决方案:
在以下数据中存在问题,因为 RateTypeID
属性 用作父项,因此在此字段中发现相同和重复的值将给出错误 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.
我实现了 kendo 树列表,但我遇到了如下问题:
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" },
}
}
}
});
最后我分析了我的数据,得到了如下解决方案:
在以下数据中存在问题,因为 RateTypeID
属性 用作父项,因此在此字段中发现相同和重复的值将给出错误 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.