PDA

View Full Version : TreeView Panel opens empty folder



2 Mar 2015, 6:48 AM
Hi,

I have implemented an Ext.Tree.View which can have many folders and items as its children (please find a fiddle short example here (https://fiddle.sencha.com/?framework=ext&version=5.0#fiddle/j0h)). For empty folders I will need to remove the expand icon (+) and folder icons to be the same as non-expanded folders.

In the fiddle example, you can see the folder child 3. Even if this is empty it has the expand icon and after expand the folder icon is changed, this scenario is quite misleading from the user perspective.

Can you please advise me how can I set this?

Thank you!
Alex Muntean.

yeghikyan
2 Mar 2015, 7:25 AM
Ext.create('Ext.tree.Panel', { renderTo: Ext.getBody(),
title: 'Simple Tree',
width: 300,
height: 250,
root: {
text: 'Root',
expanded: true,
children: [{
text: 'Child 1',
leaf: true
}, {
text: 'Child 2',
leaf: true
}, {
text: 'Child 3',
leaf: false, // This
children: [] // and this
}]
}
});
or appropriate icon cls with leaf true...