PDA

View Full Version : Autoadjust height TreePanel



pporto
27 Sep 2011, 11:17 AM
Hi there,

How to set height of TreePanel auto-adjustable?

One time wich there is no more the autoHeight config.

I've tried layout: 'fit and align:' stretch ', but does not work.

skirtle
27 Sep 2011, 10:59 PM
Here's a way that works in very simple cases:

http://www.sencha.com/forum/showthread.php?146090

As I said on that thread, autoheighting is rarely a good idea in practice. When I get time I'm going to investigate writing a plugin to do this for the few cases where it does make sense.

pporto
28 Sep 2011, 5:43 AM
28385
Here's a way that works in very simple cases:

http://www.sencha.com/forum/showthread.php?146090

As I said on that thread, autoheighting is rarely a good idea in practice. When I get time I'm going to investigate writing a plugin to do this for the few cases where it does make sense.

Hello skitle,

Thanks for tips. But don't work.

See my code and my situation:



...
Ext.create('Ext.form.Panel', {
items: [{
xtype: 'combo',
id: 'comboLocalPesquisa',
fieldLabel: 'Local',
store: localStore,
valueField: 'local_id',
displayField: 'nome',
listeners: {
select: function(f, v, o) {
var tree = Ext.getCmp('treeTipoDocumento');
var treeStore = tree.getStore();

new Ext.LoadMask(tree.el, {msg: 'Carregando...', store: tree.store});

treeStore.getProxy().extraParams['local_id'] = f.getValue();
treeStore.load();
}
}
}, {
xtype: 'treepanel',
id: 'treeTipoDocumento',
title: 'Tipo de documento',
store: tipodocumentoStore,
rootVisible: false,
listeners: {
afterrender: function() {
this.getEl().setStyle('height', 'auto');
this.body.setStyle('height', 'auto');
this.getView().getEl().setStyle('height', 'auto');
}
}
}]
});


When select a "Local", the treepanel is loaded. However, treepanel be height limited. Even with your tip.

Any suggestion?