The nodes in the treepanels are Ext.data.NodeInterface
objects.
It doesn't have disabled or hidden properties, but it has cls
and with that you can add a display: none
style to it which is hiding the node.
Example:
in css file:
.x-hidden-node {display: none !important;}
in extjs code:
root: { expanded: true, id: 'treeview1', children: [{ text: 'Make Copy', leaf: true, id:'HS1', cls : 'x-hidden-node' }] }
For the disabled functionality, you can use the treepanel's beforeitemclick
event in which you can manually read the disabled property.
Example:
Ext.create('Ext.tree.Panel', {
(...)
listeners: {
beforeitemclick: function(treeview, record, item, index, e, eOpts) {
if (record.raw && record.raw.disabled == true) {
return false;
}
return true;
},
itemclick: function(treeview, record, item, index, e, eOpts) {
console.log(record, item);
}
}
});