jqueryangularkendo-treelist

Maximum call stack size exceeded in kendo Tree List


I implement kendo Tree List but i got some problem as following:

RangeError: Maximum call stack size exceeded
at init._defaultParentId

Code:

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" },
                            }
                        }
                    }
                });

Solution

  • Finally i am analyse my data and i got the solution as follow:

    In following data has been problem because RateTypeID property use as a parent so same and duplicate values found in this field it will give an error 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.