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

Expand single node onClick

8 Answers 235 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
saroj
Top achievements
Rank 1
saroj asked on 28 May 2013, 12:22 AM
Hi support,

I am using Kendo TreeView and i am trying to make only single node is expanded at a time i.e only the clicked node gets expanded and other is collapsed, but couldn't do so, could you please help me with this.  I am using Expand event in treeview and below is my code.

<script type="text/javascript"> 
var procesing = false;   
function Expand (e) {        
        if (!procesing) {
                        procesing = true;
                        var tree = $('#TreeView').data('kendoTreeView')
                       closeSib($(e.node), tree)
                       procesing = false; 
        }
    }
    function closeSib($element, tree) {        
                      var $siblings = $element.siblings();
                      tree.collapse($siblings);
            if ($element.parent('li').length > 0) {
                      closeSib($element.parent('li'), tree);
        }
    }
</script>

8 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 28 May 2013, 10:02 AM
Hello Saroj,


I think that you are on the right way to go. The collapse method of the TreeView API accepts single or many tree items, so in the current scenario you could pass the collection of all siblings.
E.g.
function expand(e) {
    var siblings = $(e.node).siblings();
    this.collapse(siblings);
}

You could also check if the sibling is an actual group or a leaf.
E.g.
function expand(e) {
    var siblings = $(e.node).siblings();
    for (var i = 0; i < siblings.length; i++) {
        if ($(siblings[i]).find("ul.k-group").length > 0) {
            this.collapse(siblings[i]);
        }
    }
}

I hope this information was helpful for you.

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
saroj
Top achievements
Rank 1
answered on 28 May 2013, 11:44 PM
Hi Dimiter,

Thanks for your reply, but it didn't work.
It only expand the first clicked nodes. It closes the siblings but doesn't expand the next node. Below is my code.

 @(Html.Kendo().TreeView()
                                .Name("RefFilesTreeView")
                                .Events(events => events.Expand("expand"))
                                .Items(treeViewItems =>
                                    {
                           treeViewItems.Add()
                                            .Text("Customers")
                                            .Items(subItem =>
                                            {
                                                subItem.Add().Text("Address");
                                                subItem.Add().Text("Customer codes");
                                                subItem.Add().Text("Customer types");
                                            });

                             treeViewItems.Add()
                                            .Text("Fleet")
                                            .Items(subItem =>
                                            {
                                   subItem.Add().Text("Annual renewals")
                                                .Items(subItem1 =>
                                                {
                                                    subItem1.Add().Text("Annual renewals CTP");
                                                    subItem1.Add().Text("Annual renewals insurance");
                                                });
                                    subItem.Add().Text("Disposal")
                                                     .Items(subItem6 =>
                                                     {
                                                         subItem2.Add().Text("Disposal method");
                                                         subItem2.Add().Text("Sale condition");
                                                     });
                                          });
                                treeViewItems.Add()
                                            .Text("Personnel")
                                            .Items(subItem =>
                                            {
                                                subItem.Add().Text("Address types");
                                                subItem.Add().Text("Policy types");
                                                subItem.Add().Text("Licence & Qualification");
                                            });
                                  });
                                    })
                            )
<script type="text/javascript">
function expand(e) {
        var siblings = $(e.node).siblings();
        this.collapse(siblings);              
    }
</script>
0
Dimiter Madjarov
Telerik team
answered on 29 May 2013, 07:15 AM
Hi Saroj,


The provided sample code works for the case, where all nodes are collapsed by default and targets the scenario, where only a single node should be expanded on the current level. I am not sure what do you mean by "doesn't expand the next node".

Could you please provide some additional information about the current case? I am looking forward to hearing from you.

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
saroj
Top achievements
Rank 1
answered on 04 Jun 2013, 11:22 PM
Hi Dimiter,

I mean when you click one node it should only expand that node and collapse all other,  but it only works for first node you click. But if you click second node it will collapse first but doesnot expand the second one.

Thanks
0
Dimiter Madjarov
Telerik team
answered on 06 Jun 2013, 11:30 AM
Hello Saroj,


I am not sure why you are experiencing this issue. Here is a short screen cast, which demonstrates the behavior of the TreeView on my side with the same event handler for the expand event.

If you are still experiencing the problem, please send me a sample project, where it is reproducing, so I could inspect it locally and assist you further.

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
saroj
Top achievements
Rank 1
answered on 06 Jun 2013, 11:35 PM
Hi Dimiter,

Here is my complete code, where i am having issue.

@(Html.Kendo().Splitter()
    .Name("RefFilesSplitter")
    .HtmlAttributes(new { @style = "height:700px;" })
    .Panes(panes =>
        {
            panes.Add()
                .Size("310px")
                .Collapsible(true)
                .Content(@<div id="RefFiles">    <br />                        
                            @(Html.Kendo().TreeView()
                                .Name("RefFilesTreeView")
                                .Events(events => events.Select("TreeView_select").Expand("TreeView_expand"))
                                .HtmlAttributes(new { @style = "color:#333; margin-left:4px;" })
                                .Items(treeViewItems =>
                                    {
                                        treeViewItems.Add()
                                            .Text("Customers")
                                            .HtmlAttributes(new { @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                            .Items(subItem1 =>
                                            {
                                                subItem1.Add().Text("Address").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem1.Add().Text("Customer codes").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem1.Add().Text("Customer types").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem1.Add().Text("Department hierarchy").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem1.Add().Text("DBRSCS treeview").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem1.Add().Text("Fleet invoicing charge centres").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem1.Add().Text("Lease charge types").HtmlAttributes(new { @style = "font-weight:normal;" });
                                            });

                                        treeViewItems.Add()
                                            .Text("Fleet")
                                            .HtmlAttributes(new { @style = "color:#333; font-weight:bold; margin-left:4px;" })
                                            .Items(subItem =>
                                            {
                                                subItem.Add().Text("Annual renewals")
                                                .Items(subItem1 =>
                                                {

                                                    subItem1.Add().Text("Annual renewals CTP").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem1.Add().Text("Annual renewals insurance").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem1.Add().Text("Annual renewals other").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem1.Add().Text("Annual renewals registration").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem1.Add().Text("Annual renewals roadside service").HtmlAttributes(new { @style = "font-weight:normal;" });

                                                });

                                                subItem.Add().Text("Copy vehicle preferences");

                                                subItem.Add().Text("Disposal")
                                                     .Items(subItem1 =>
                                                     {
                                                         subItem1.Add().Text("Disposal method").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                         subItem1.Add().Text("Sale condition").HtmlAttributes(new { @style = "font-weight:normal;" });

                                                     });

                                                subItem.Add().Text("Fleet items")
                                                   .Items(subItem1 =>
                                                   {

                                                       subItem1.Add().Text("Body type").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Drive type").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Fleet category").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Fleet cost type").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Fleet type").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Fuel type").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Location(current)").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("MMS/Regime").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("MMS treeview").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Option/Accessories").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Ownership").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Projects").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Transmission").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Vehicle type").HtmlAttributes(new { @style = "font-weight:normal;" });

                                                   });

                                                subItem.Add().Text("Lease")
                                                     .Items(subItem1 =>
                                                     {
                                                         subItem1.Add().Text("Activity type").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                         subItem1.Add().Text("Lease components").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                         subItem1.Add().Text("Lease types").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                         subItem1.Add().Text("Lessor").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                     });

                                            });

                                        treeViewItems.Add()
                                                .Text("Hire")
                                                .HtmlAttributes(new { @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                                .Items(subItem =>
                                                {

                                                    subItem.Add().HtmlAttributes(new { @style = "font-weight:normal;" }).Text("Hire pickup location");
                                                    subItem.Add().HtmlAttributes(new { @style = "font-weight:normal;" }).Text("Hire pool");
                                                    subItem.Add().HtmlAttributes(new { @style = "font-weight:normal;" }).Text("Hire profile");
                                                    subItem.Add().HtmlAttributes(new { @style = "font-weight:normal;" }).Text("Hire unavailable reasons");
                                                    subItem.Add().HtmlAttributes(new { @style = "font-weight:normal;" }).Text("Hire vehicle type");
                                                    subItem.Add().HtmlAttributes(new { @style = "font-weight:normal;" }).Text("Hire vehicle type profile");
                                                    subItem.Add().HtmlAttributes(new { @style = "font-weight:normal;" }).Text("Job numbers");
                                                    subItem.Add().HtmlAttributes(new { @style = "font-weight:normal;" }).Text("Purpose of trip");

                                                });


                                        treeViewItems.Add()
                                            .Text("Incidents")
                                            .HtmlAttributes(new { @class = "k-b", @id = "b", @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                            .Items(subItem =>
                                            {
                                                subItem.Add().Text("Accidents")
                                                   .Items(subItem1 =>
                                                   {

                                                       subItem1.Add().Text("Categories").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Road conditions").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("States").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Traffic conditions").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                       subItem1.Add().Text("Weather conditions").HtmlAttributes(new { @style = "font-weight:normal;" });

                                                   });
                                                subItem.Add().Text("Infringement types");
                                            });

                                        treeViewItems.Add()
                                           .Text("Interface")
                                           .HtmlAttributes(new { @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                           .Items(subItem =>
                                           {
                                               subItem.Add().HtmlAttributes(new { @Style = "font-weight:normal;" }).Text("Accounts");
                                           });

                                        treeViewItems.Add()
                                            .Text("Inventory")
                                            .HtmlAttributes(new { @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                            .Items(subItem =>
                                            {
                                                subItem.Add().Text("Inventory category").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem.Add().Text("Inventory costing").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem.Add().Text("Inventory location").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem.Add().Text("Unit of measurement").HtmlAttributes(new { @style = "font-weight:normal;" });
                                            });

                                        treeViewItems.Add()
                                            .Text("Personnel")
                                            .HtmlAttributes(new { @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                            .Items(subItem =>
                                            {
                                                subItem.Add().Text("Address types").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem.Add().Text("Policy types").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                subItem.Add().Text("Licence & Qualification").HtmlAttributes(new { @style = "font-weight:normal;" });
                                            });


                                        treeViewItems.Add()
                                            .Text("Repair & Maintenance")
                                            .HtmlAttributes(new { @class = "k-a", @id = "a", @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                            .Items(subItem =>
                                                {

                                                    subItem.Add().Text("Depot").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Depot user access").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Findings").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Hour types codes").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Job class").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Job level").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Kits").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Mechanic comments").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("MMSB parts").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    //subItem.Add().Text("Inventory categories");
                                                    //subItem.Add().Text("Inventory locations");
                                                    subItem.Add().Text("Parts").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Programmed services").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Requirements").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Service regimes").HtmlAttributes(new { @style = "font-weight:normal;" });
                                                    subItem.Add().Text("Transport vehicles").HtmlAttributes(new { @style = "font-weight:normal;", @title = "Vehicles used to transport other vehicles" });
                                                    subItem.Add().Text("Workgroups").HtmlAttributes(new { @style = "font-weight:normal;" });

                                                });

                                        treeViewItems.Add()
                                           .Text("Suppliers")
                                           .HtmlAttributes(new { @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                           .Items(subItem =>
                                           {
                                               subItem.Add().Text("Supplier codes").HtmlAttributes(new { @style = "font-weight:normal;" });
                                           });

                                        treeViewItems.Add()
                                           .Text("System")
                                           .HtmlAttributes(new { @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                           .Items(subItem =>
                                           {
                                               subItem.Add().Text("Domain").HtmlAttributes(new { @style = "font-weight:normal;" });
                                           });


                                        treeViewItems.Add()
                                           .Text("Transactions")
                                           .HtmlAttributes(new { @style = "color:#333;font-weight:bold; margin-left:4px;" })
                                           .Items(subItem =>
                                           {

                                               subItem.Add().Text("Annual renewals").HtmlAttributes(new { @style = "font-weight:normal;" });
                                               subItem.Add().Text("E-Tolls").HtmlAttributes(new { @style = "font-weight:normal;" });
                                               subItem.Add().Text("Fuel")
                                                   .Items(subItem1 =>
                                               {
                                                   subItem1.Add().Text("Supplier references").HtmlAttributes(new { @style = "font-weight:normal;" });

                                               });



                                           });


                                    })
                            )
                
                        </div>);
            panes.Add()
                .Content(@<div id="RefFilesContent"></div>);
        })

)
<script type="text/javascript">
    var refFilesTreeView;

    $(document).ready(function () {
        refFilesTreeView = $("#RefFilesTreeView").data("kendoTreeView");
        
    });
    
    function TreeView_select(e){
        var selectedNodeText = refFilesTreeView.text(e.node);       

        if (selectedNodeText == "Findings")
            $('#RefFilesContent').load('@Url.Action("FindingList", "FindingList")');
        else if (selectedNodeText == "Job class")
            $('#RefFilesContent').load('@Url.Action("JobClassList", "JobClassList")');
        else if (selectedNodeText == "Job level")
            $('#RefFilesContent').load('@Url.Action("JobLevelList", "JobLevelList")');
//        else if (selectedNodeText == "Inventory categories")
//            $('#RefFilesContent').load('@Url.Action("InventoryCategoryList", "InventoryCategoryList")');
//        else if (selectedNodeText == "Inventory locations")
//            $('#RefFilesContent').load('@Url.Action("InventoryLocationList", "InventoryLocationList")');
        else if (selectedNodeText == "Parts")
            $('#RefFilesContent').load('@Url.Action("PartList", "PartList")');
        else if (selectedNodeText == "Requirements")
            $('#RefFilesContent').load('@Url.Action("RequirementList", "RequirementList")');
        else if (selectedNodeText == "Kits")
            $('#RefFilesContent').load('@Url.Action("KitList", "KitList")');
        else if (selectedNodeText == "Service regimes")
            $('#RefFilesContent').load('@Url.Action("ServiceRegimeList", "ServiceRegimeList")');
        else if (selectedNodeText == "MMSB parts")
            $('#RefFilesContent').load('@Url.Action("MMSBList", "MMSBList")');        
        else if (selectedNodeText == "Hour types codes")
            $('#RefFilesContent').load('@Url.Action("HireoutTypeList", "HireoutTypeList")');
        else if (selectedNodeText == "Mechanic comments")
            $('#RefFilesContent').load('@Url.Action("MechanicCommentList", "MechanicCommentList")');
        else if (selectedNodeText == "Workgroups")
            $('#RefFilesContent').load('@Url.Action("WorkgroupList", "WorkgroupList")');
        else if (selectedNodeText == "Depot")
            $('#RefFilesContent').load('@Url.Action("DepotList", "DepotList")');
        else if (selectedNodeText == "Programmed services")
            $('#RefFilesContent').load('@Url.Action("ProgrammedServiceList", "ProgrammedServiceList")');
        else if (selectedNodeText == "Depot user access")
            $('#RefFilesContent').load('@Url.Action("UserLookupDepotList", "UserLookupDepotList")');
        else if (selectedNodeText == "Transport vehicles")
            $('#RefFilesContent').load('@Url.Action("MaintenanceVehicleList", "MaintenanceVehicleList")');

        else if (selectedNodeText == "Infringement types")
            $('#RefFilesContent').load('@Url.Action("InfringementTypeList", "InfringementTypeList")');

        else if (selectedNodeText == "States")
            $('#RefFilesContent').load('@Url.Action("AccidentStatesList", "AccidentStatesList")');
        else if (selectedNodeText == "Categories")
            $('#RefFilesContent').load('@Url.Action("AccidentCategoriesList", "AccidentCategoriesList")');
        else if (selectedNodeText == "Weather conditions")
            $('#RefFilesContent').load('@Url.Action("AccidentWeatherConditionsList", "AccidentWRTConditionsList")');
        else if (selectedNodeText == "Road conditions")
            $('#RefFilesContent').load('@Url.Action("AccidentRoadConditionsList", "AccidentWRTConditionsList")');
        else if (selectedNodeText == "Traffic conditions")
            $('#RefFilesContent').load('@Url.Action("AccidentTrafficConditionsList", "AccidentWRTConditionsList")');
            
        else if (selectedNodeText == "Inventory costing")
            $('#RefFilesContent').load('@Url.Action("InventoryCostingList", "InventoryCostingList")');
        else if (selectedNodeText == "Unit of measurement")
            $('#RefFilesContent').load('@Url.Action("UnitOfMeasurementList", "UnitOfMeasurementList")');
        else if(selectedNodeText == "Supplier references")
            $('#RefFilesContent').load('@Url.Action("SupplierReferences", "FuelSupplierReferences")');

        else if (selectedNodeText == "Domain")
            $('#RefFilesContent').load('@Url.Action("AusfleetSystemDomain", "AusfleetSystemDomain")');

        else if (selectedNodeText == "Annual renewals CTP")
            $('#RefFilesContent').load('@Url.Action("AnnualRenewalsCTPList", "AnnualRenewalsCTPList")');
        else if (selectedNodeText == "Annual renewals insurance")
            $('#RefFilesContent').load('@Url.Action("AnnualRenewalsInsuranceList", "AnnualRenewalsInsuranceList")');
        else if (selectedNodeText == "Annual renewals other")
            $('#RefFilesContent').load('@Url.Action("AnnualRenewalsOtherList", "AnnualRenewalsOtherList")');
        else if (selectedNodeText == "Annual renewals registration")
            $('#RefFilesContent').load('@Url.Action("AnnualRenewalsRegistrationList", "AnnualRenewalsRegistrationList")');
        else if (selectedNodeText == "Annual renewals roadside service")
            $('#RefFilesContent').load('@Url.Action("AnnualRenewalsRoadsideServiceList", "AnnualRenewalsRoadsideServiceList")');

        else if (selectedNodeText == "Copy vehicle preferences")
            $('#RefFilesContent').load('@Url.Action("CopyVehiclePreferencesList", "CopyVehiclePreferencesList")');

        else if (selectedNodeText == "Disposal method")
            $('#RefFilesContent').load('@Url.Action("DisposalMethodList", "DisposalMethodList")');
        else if (selectedNodeText == "Sale condition")
            $('#RefFilesContent').load('@Url.Action("SaleConditionList", "SaleConditionList")');
        else if (selectedNodeText == "Body type")
            $('#RefFilesContent').load('@Url.Action("BodyTypeList", "BodyTypeList")');
        else if (selectedNodeText == "Drive type")
            $('#RefFilesContent').load('@Url.Action("DriveTypeList", "DriveTypeList")');

        else if (selectedNodeText == "Hire pickup location")
            $('#RefFilesContent').load('@Url.Action("HirePickupLocationList", "HirePickupLocationList")');
        else if (selectedNodeText == "Hire vehicle type")
            $('#RefFilesContent').load('@Url.Action("HireVehicleTypeList", "HireVehicleTypeList")');
        else if (selectedNodeText == "Hire pool")
            $('#RefFilesContent').load('@Url.Action("HirePoolList", "HirePoolList")');
        else if (selectedNodeText == "Purpose of trip")
            $('#RefFilesContent').load('@Url.Action("PurposeofTripList", "PurposeofTripList")');
        else if (selectedNodeText == "Hire unavailable reasons")
            $('#RefFilesContent').load('@Url.Action("HireUnavailableReasonsList", "HireUnavailableReasonsList")');
        else if (selectedNodeText == "Hire vehicle type profile")
            $('#RefFilesContent').load('@Url.Action("HireVehicleTypeProfileList", "HireVehicleTypeProfileList")');
        else if (selectedNodeText == "Job numbers")
            $('#RefFilesContent').load('@Url.Action("JobNumbersList", "JobNumbersList")');
        else if (selectedNodeText == "Hire profile")
            $('#RefFilesContent').load('@Url.Action("HireProfileList", "HireProfileList")');

        else if (selectedNodeText == "Accounts")
            $('#RefFilesContent').load('@Url.Action("InterfaceAccountsList", "InterfaceAccountsList")');

        else if (selectedNodeText == "Address types")
            $('#RefFilesContent').load('@Url.Action("AddressTypesList", "AddressTypesList")');
        else if (selectedNodeText == "Policy types")
            $('#RefFilesContent').load('@Url.Action("PolicyTypesList", "PolicyTypesList")');
        else if (selectedNodeText == "Licence & Qualification")
            $('#RefFilesContent').load('@Url.Action("LicenceAndQualification", "LicenceAndQualification")');

        else if (selectedNodeText == "Supplier codes")
            $('#RefFilesContent').load('@Url.Action("SupplierCodesList", "SupplierCodesList")');

    }

    function TreeView_expand(e) {
        var siblings = $(e.node).siblings();
    this.collapse(siblings);
              
    }
   

</script>
0
saroj
Top achievements
Rank 1
answered on 07 Jun 2013, 01:20 AM
Hi Dimiter,

That treeview code works when i tested using new version of kendo jquery project but we haven't updated our project  after 2012 Q3 version. Do you think is that the problem?

Thanks in advance
0
Dimiter Madjarov
Telerik team
answered on 10 Jun 2013, 08:41 AM
Hi Saroj,


The provided code is correct. I have tested the approach with the Q3 2012 release and it is working as expected. Please make sure that are no other JavaScript errors in the console.

For your convenience I prepared a sample solution, which is using Q3 2012 version with the code that you provided. I removed just the custom code in the select event. I hope that it covers the current scenario.

I wish you a great day!

Regards,
Dimiter Madjarov
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
saroj
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
saroj
Top achievements
Rank 1
Share this question
or