PDA

View Full Version : [3.3.1]TreePanel LoadMask



swarm
11 Feb 2010, 1:39 PM
Hi,

Does anyone know if it's possible to include a loadmask on a treepanel as it's loading in remote data?

I've tried with a custom loadMask, but I can't believe that it's the only way... surely this is one of the things that's easy to do (e.g. with config option load: true or something)...

Any thoughts?



var navigation = function(treeitems){
return new Ext.tree.TreePanel({
id: 'navigation-tree-' + treeitems,
border: false,
animate: true,
rootVisible: false,
lines: false,
singleExpand: true,
useArrows: true,
loader: new Ext.tree.TreeLoader({
dataUrl: 'server/' + treeitems + '.json',
requestMethod: 'GET'
}),
root: new Ext.tree.AsyncTreeNode(),
listeners: {
click: function(n){
var sn = this.selModel.selNode || {};
if (n.leaf && n.id != sn.id) {
Ext.getCmp('content-panel').removeAll(true);
var itemName = n.id;
Ext.getCmp('content-panel').add({
xtype: itemName
});
Ext.getCmp('content-panel').layout.setActiveItem(n.id + '-panel');
}
}
}
});
};