This is a migrated thread and some comments may be shown as answers.

Too Much Recursion

5 Answers 223 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
John Stephens
Top achievements
Rank 1
John Stephens asked on 07 Jan 2013, 04:46 PM
When I bind to a remote data source that returns this data:

[{"Id":1,"Name":"N0014E0","Devices":null},{"Id":2,"Name":"N0014E1","Devices":null}]

I receive a Too Much Recursion Error.

Modified code from the demo:


var serviceRoot = "http://localhost:8211";
 
homogeneous = new kendo.data.DataSource({
  transport: {
    read: {
      url: serviceRoot + "/reporting/JsonControllers",
      dataType: "jsonp"
      }
    },
    schema: {
      model: {
        id: "Id",
        name: "Name",
      }
    }
});
 
$("#treeview").kendoTreeView({
    dataSource: homogeneous,
    dataTextField: "Name"
});

5 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 08 Jan 2013, 08:13 AM
Hello John,

In order to bind the treeview properly, you need to use a HierarchicalDataSource. Here is a jsbin sample that mocks the data and binds the treeview. I could not reproduce the "too much recursion" error, but it is something that we have encountered before and fixed it in the latest internal builds -- you can use them to address the issue.

All the best,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
William
Top achievements
Rank 1
answered on 18 Dec 2013, 09:59 PM
I am trying to load data to a treeview but I get "too much recursion...f(this._isServerGrouped()){var i,o=t.toJSON();return e.length&&(i=e[e.length-1])..."
The treeview is inside a bootstrap container, and browser is firefox.

html
    <div class="container">
        <div class="row top-buffer">
            <div class="col-md-4 ">
                <div class="treeview-back">
                    <div id="treeview111" style = "height:200px;" class="demo-section"></div>


Javascript is:
<script>
        var serviceRoot = "http://localhost:37790/Home";
        var homogeneous = new kendo.data.HierarchicalDataSource({
            transport: {
                read: {
                    url: serviceRoot + "/GetIndicatorsGroups",
                    dataType: "jsonp"
                }
            },
            schema: {
                model: {
                    id: "GroupId",
                    hasChildren: "HasIndicators"
                }
            }
        });

        $("#treeview111").kendoTreeView({
            dataSource: homogeneous,
            dataTextField: "FullName"
        });
</script>

Controller is:

        public JsonResult GetIndicatorsGroups()
        {
            var context = new DashboardEntities();
            context.Configuration.ProxyCreationEnabled = false;

            var query = context.DashIndicatorGroups.Include(i => i.DashIndicators)
                .Select(group => new
                {
                    GroupId = group.IndicatorGroupId,
                    FullName = group.Name,
                    HasIndicators = (group.DashIndicators.Count > 0)
                });

            return Json(query, JsonRequestBehavior.AllowGet);
        }

I hope somebody could help me with this issue.

Regards
William Castro
0
Alex Gyoshev
Telerik team
answered on 19 Dec 2013, 09:58 AM
Hello William,

Please provide a sample that shows the issue. Here is one to get you started.

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
William
Top achievements
Rank 1
answered on 19 Dec 2013, 03:37 PM
Alex, 

I think i have a conflict between kendo.web.min.js and kendo.dataviz.min.js.
Could you try in your sample adding following line, below  kendo.web.min.js, declaration 
    <script src="http://cdn.kendostatic.com/2013.3.1119/js/kendo.dataviz.min.js"></script>

In my case it show "loading ... " when

In my application ocurrs something like when I have 
    <script src="@Url.Content("~/Scripts/kendo/kendo.web.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/kendo.dataviz.min.js")"></script>
and in addition show the error: 
TypeError: s is undefined...tor(e);return function(e,n){var i=t(e),a=t(n);return i&&i.getTime&&a&&a.getTime&... in kendo.web.min.js

http://jsbin.com/IlAtOLU/1/

But when I delete the kendo.datavis.min.js  declaration it works !

Thanks
William Castro.
0
Alex Gyoshev
Telerik team
answered on 19 Dec 2013, 04:48 PM
Hello WIlliam,

Yes, kendo.web.js and kendo.dataviz.js both include the core framework. If you want to use both of them on the same page, either use kendo.all or build a custom distribution through the custom download builder. See the javascript dependencies help topic about more information.

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
John Stephens
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
William
Top achievements
Rank 1
Share this question
or