PDA

View Full Version : rootvisible false doesn't work



geniodella
31 Mar 2012, 4:14 AM
Hi Guys i am trying to hide the root from the tree that i created
but noway the root is going to disappear i am using the mvc this is the treepanel config :

// Go ahead and create the TreePanel now so that we can use it below

Ext.define('Pandora.view.TreePanel', {
extend: 'Ext.tree.Panel',
alias: 'widget.menuTree',
rootVisible: false,

initComponent: function() {
this.store =
console.log('initComponent of View...');

Ext.apply(this, {
title: 'Simple Tree',
width: 200,
collapsible: true,
rootVisible: false,
singleExpand: true,
store: {
proxy: {
type: 'ajax',
url: 'MenuAction.action'
}
}
});

this.callParent(arguments);
}
});

mitchellsimoens
31 Mar 2012, 8:34 AM
What Ext JS 4 version?

geniodella
31 Mar 2012, 8:38 AM
4.0.7

should i override something from a newer version?

mitchellsimoens
31 Mar 2012, 8:43 AM
This seems to be working in 4.1.0 RC1 now. Testing with the xml-tree.html example I had to remove the viewConfig and the plugin within it to get it to hide but it is working in 4.1.0 RC1

geniodella
31 Mar 2012, 8:46 AM
Thank you very much Mitchell,
i will try this solution

geniodella
1 Apr 2012, 2:39 PM
Hi Mitchell ,
did you try creating a tree using the MVC,
it is in this situation that the rootVisible creates problems.

lorak
28 Jun 2012, 3:33 PM
Howdy,

I'm using ExtJs 4.0.1 and was having the same problem:

Setting rootVisible : false within a tree.panel view does not work.

However, I was able to hide the root node by setting rootVisible: false within the app.js file.



Ext.application({
(some code)
launch: function(){
//create an instance of the viewport class
Ext.create('Ext.container.Viewport',{
(some code)
items:[{
xtype:'container' ,
columnWidth: .40,
items:[{
xtype:'itemtree',
rootVisible:false,
height: 226,
margin:
'0 0 20px 0'
}, (some code)

where 'xtype:itemtree' is the alias I gave my tree view. Hope this helps!

geniodella
28 Jun 2012, 3:51 PM
Hi,
i sorted it out building the json in the right way,
that was my problem but yet i assign the store directly
in the controller init function.