Implementing Tree List with data from server

173 views Asked by At

I'm having some problems implementing this Tree List using Kendo-UI TreeList component. This is the dataFromServer JSON response, I am currently using - https://jsonblob.com/74e85b0c-e536-11e9-910e-1d39c834ac84

            let tree = $("#treelist").kendoTreeList({

                dataSource: {

                    data: dataFromServer,

                    schema: {

                        model: {

                            id: "employeeId",

                            parentId: "reportTo",

                            fields: {

                                reportTo: { nullable: true },

                                employeeId: { type: "number" }

                            },

                            expanded: true

                        }

                    }

                },
                columns: [
                    {
                        field: "employeeId",
                        title: "Id"
                    },
                    {
                        field: "product",
                        title: "Product"
                    },
                    {
                        field: "dataCol",
                        title: "Data"
                    }

                ]

            }).data("kendoTreeList");

This is how I'm initializing the TreeList, following the documentation at https://demos.telerik.com/kendo-ui/treelist/index and my browser can't render it, displaying an error "Paused before a potential out-of-memory crash" and an endless call stack. I've tried with other data from the documentation examples and it worked. I tried changing the root parentId from -1 to null, so as to match the requirements, and result is the same. Can some one explain what is wrong with this data from server and initialization? Thanks.

0

There are 0 answers