This is a migrated thread and some comments may be shown as answers.
Unable to expand treeview node
3 Answers 72 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frode
Top achievements
Rank 1
Frode asked on 05 Jul 2010, 12:58 PM
Hi, I'm using the .518 version of the TreeView.

I'm trying to use the treeview control on an existing MVC site, and have added the following files:
- Content/telerik.common.min.css
- Content/telerik.default.min.css
- Content/Default folder with 4 files
- Scripts/jquery-1.4.2.min.js
- Scripts/telerik.common.min.js
- Scripts/telerik.treeview.min.js

I've got the treeview displayed with a few initial nodes, but when I click on the plus-icon nothing happens. The ajax/webservice method is not called.
When I hover the mouse over the plus-icon it does turn into a hand.

Here is my View:

 <!-- Add CSS stylesheets -->
    <%= Html.Telerik().StyleSheetRegistrar()
        .DefaultGroup(group => 
            group.Add("telerik.default.css")
            .Add("telerik.common.css")
                )
    %>

    <!-- Add Javascript. Uses jquery-1.4.2.min.js -->
    <%= Html.Telerik().ScriptRegistrar().DefaultGroup(group => group
            .Add("telerik.common.min.js")
            .Add("telerik.treeview.min.js")
        ) %> 

    <!-- Create HTML for treeview -->
    <%= Html.Telerik().TreeView()
        .Name("ChildrenTreeView")
        .BindTo(Model, (item, hierarkicompany) =>
                           {
                               item.Text = hierarkicompany.Name;
                               item.Value = hierarkicompany.Number.ToString();
                               item.LoadOnDemand = true;
                               //item.Enabled = true;
                           })
        .DataBinding(dataBinding => dataBinding.WebService().Select("~/Models/HierarkiService.svc/GetChildren"))
            
        %>

When I use FireBug I see that the three js scripts jquery-1.4.2.min.js, telerik.common.min.js and telerik.treeview.min.js, are loaded.

Am I missing any files? What could be the reason that the Servicemethod isn't called?

Thanks,
Frode

3 Answers, 1 is accepted

Sort by
0
Frode
Top achievements
Rank 1
answered on 09 Jul 2010, 07:46 AM
Anyone?
0
Frode
Top achievements
Rank 1
answered on 09 Jul 2010, 10:16 AM
Figured it out. The ScriptRegistrar needs to come AFTER the treeview.
0
Vadim
Top achievements
Rank 1
answered on 26 Jul 2011, 01:18 PM
Thanks, that worked for me also.
Tags
General Discussions
Asked by
Frode
Top achievements
Rank 1
Answers by
Frode
Top achievements
Rank 1
Vadim
Top achievements
Rank 1
Share this question
or