1. #11
    Sencha User
    Join Date
    Feb 2015
    Posts
    25
    Vote Rating
    1
    albanirneves is on a distinguished road

      0  

    Default Fixed

    For ExtJS 6, for example, when read config is false, hide the node:

    Code:
        hideItemsReadFalse: function () {
            var me = this,
                items = me.getReferences().treelistRef.itemMap;
    
    
                for(var i in items){
                    if(items[i].config.node.data.read == false){
                        items[i].destroy();
                    }
                }
        }



    Code:
    {
        "text": "root",
        "children": [
            {
                "text": "Atualização",
                "iconCls": "x-fa fa-list",
                "children": [
                    {
                        "leaf":true,
                        "text": "Empresas",
                        "module": "empresas",
                        "iconCls": "x-fa fa-building",
                        "create": true,
                        "read": false,
                        "update": true,
                        "destroy": true
                    },
                    {
                        "leaf":true,
                        "text": "Produtos",
                        "module": "produtos",
                        "iconCls": "x-fa fa-cubes",
                        "read": true
                    }
                ]
            }
        ]
    }
    Thanks
    Albanir Neves

  2. #12
    Sencha User
    Join Date
    May 2016
    Posts
    1
    Vote Rating
    0
    sunilgarg7 is on a distinguished road

      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    Unfortunately there is no way to hide a node. You could remove a node (cache it's position) and then add a node back in.
    I think there is an easy way to do hide a node

    you just add a class in your css files

    .hideTreeNode {
    display :none;
    }


    and then just set this class as css to your node

    node.set('cls','hideTreeNode');

    and voilllla your tree node will not be visible on tree