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
}
]
}
]
}