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

Treeview disables, not the expand element

6 Answers 722 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Freddy
Top achievements
Rank 1
Freddy asked on 19 Jul 2013, 11:39 AM
Hi,

I have a treeview widget with a single root node which is disabled at page load and is set to on demand loading. Problem is that the treeview node itself is properly disabled but the expand button is not. When I click on the expand button the sub-items are loaded and displayed. When I then try to collapse the node again I can't. When I enable and disable the treeview again _after_ sub items were loaded under the root node the behavior is correct again. I.E. I can no longer expand the root node.

I disable the treeview using $("#treeview").data("kendoTreeView").enable('.k-item', false);
I can see the same behavior on IE 10, Firefox 20.0.1 and Chrome 28.0.1500.72.
I am using the MVC wrappers version 2013.1.514.

I apologize if this has been reported before. I did search the forums but could not find this issue anywhere.

6 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 23 Jul 2013, 07:36 AM
Hello Freddy,

I believe that this bug has been fixed in the Q2 release, 2013.2.716.

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
Dimiter Madjarov
Telerik team
answered on 23 Jul 2013, 08:00 AM
Hi Feddy,


We managed to reproduce the issue. It appears to be different, than the one, mentioned by my colleague Alex. We have logged it for fixing from the development team.

I also updated your Telerik points.

 

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
Sreejith
Top achievements
Rank 1
answered on 12 Nov 2015, 06:45 PM

Hi,

Is this issue resolved? hod do I stop a treeview from expanding when it is disabled?

This is the code i use to disable.

            var dataItem = dataSource.get(arrDisableIds[j]); // find item with id
            var node = treeview.findByUid(dataItem.uid);
            treeview.enable(node, false);

 

Thanks

Sree

0
Dimiter Madjarov
Telerik team
answered on 13 Nov 2015, 12:07 PM

Hello Sreejith,

This issue is from a very old Kendo UI version from 2013. Are you experiencing similar problem with a recent Kendo UI version?

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
Sreejith
Top achievements
Rank 1
answered on 13 Nov 2015, 02:05 PM

Hi Dimiter,

My Kendo version is "2015.3.930".

I wanted to disable few items in the tree-view and I've done it, the code is below. Is this the right way to do it ? 

 

 

    function DiableVarTreeNodes() {
        //Get all the Tree View item IDs, which you going to disable, this is being passed from server-side and stored in hidden field
        var disableIds = $("#VarIDToDiable").val();
        var arrDisableIds = disableIds.split(',');
        var treeview = $("#VariablesTree").data("kendoTreeView");
        var dataSource = treeview.dataSource;
        //Loop thru the each Ids of the Treeview, for the ones you want to disable
        for (var j = 0; j < arrDisableIds.length; j++)
        {
            var dataItem = dataSource.get(arrDisableIds[j]); // find item with id
            //dataItem.hasChildren = false;
            //dataItem.indeterminate = false;            
            var node = treeview.findByUid(dataItem.uid);            
            $(node.children()).find('input:checkbox').prop("checked", false);//Clear the check-box selection
            $(node.children()).find('input:checkbox').prop("indeterminate", false);//Clear check box if its partially selected
            $(node.children().children()[0]).removeClass() //Remove the css class for the expand collapse arrow
            $(node.children().children()[0]).addClass("k-icon k-plus-disabled"); //Add back it with disabled
            treeview.enable(node, false); //disable tree items
        }
    }

 

 

 

Thanks

Sree 

 

 

 

 

 

0
Dimiter Madjarov
Telerik team
answered on 16 Nov 2015, 08:39 AM

Hello Sreejith,

Yes, using the enable method of the TreeView API, with a second parameter set to false, is the correct way to disable a node.

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
Freddy
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Dimiter Madjarov
Telerik team
Sreejith
Top achievements
Rank 1
Share this question
or