Click here to Skip to main content
15,886,648 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Getting a Run time Error while executing a Kendo Tree view (Unable to Collapse the Tree view nodes) tried different techniques but unable to trace the root cause of this error. while running the code in Chrome browser run time error is not populated with no desired out put in IE runtime error is being populated with no desired output.
how do i make tree view to collapse its nodes.

0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'kendoTreeView'
JavaScript
@(Html.Kendo().TreeView()
      .Name("treeview2") 
      .Items(items =>
      {
          items.Add().Text("Item 3") 
          .Expanded(true)
          .Items(item3 =>
             {
                 item3.Add().Text("child item3-1");
                 item3.Add().Text("child item3-2");
             });
          items.Add().Text("Item4")
              .Expanded(true)
              .Items(item4 =>
                  {
                      item4.Add().Text("Child item4-1");
                      item4.Add().Text("Child item4-2");
                  });
      })
)


and its reference are :

<head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title - My ASP.NET MVC Application</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
        <link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
        <link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.rtl.min.css" rel="stylesheet" type="text/css" />
        <link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
        <link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css" />
        <link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.dataviz.default.min.css" rel="stylesheet" type="text/css" />
        <link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
        <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
        <script src="http://cdn.kendostatic.com/2012.3.1114/js/kendo.all.min.js"></script>
        </head>
Posted

1 solution

Hello,
This issue has been resolved . its an MVC4 application, in the _layout.cshtml we have a statement

@Scripts.Render("~/bundles/jquery")


while rendering the view to html the above statement generates another JQuery.js file.
This makes the popping up of the run time error.
Hence by removing or commenting the above statement in the _layout.cshtml file the run time error will be removed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900