Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Show/Hide of the tree node in ExtJS 4

  1. #11
    Sencha User
    Join Date
    Feb 2015
    Posts
    25
    Vote Rating
    1
      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": "Atualizao",
                "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
      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

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •