Treeview disables, not the expand element

7 posts, 0 answers
  1. Freddy
    Freddy avatar
    1 posts
    Member since:
    Oct 2012

    Posted 19 Jul 2013 Link to this post

    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.
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 23 Jul 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 23 Jul 2013 Link to this post

    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!
  5. Sreejith
    Sreejith avatar
    4 posts
    Member since:
    Jan 2013

    Posted 12 Nov 2015 Link to this post

    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

  6. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 13 Nov 2015 Link to this post

    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!
     
  7. Sreejith
    Sreejith avatar
    4 posts
    Member since:
    Jan 2013

    Posted 13 Nov 2015 in reply to Dimiter Madjarov Link to this post

    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 

     

     

     

     

     

  8. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 16 Nov 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready