PDA

View Full Version : Treepicker don't display text and don't scroll



sergiomichels
13 Aug 2013, 7:02 AM
I'm trying the Ext.ux.TreePicker. My store is already loaded in another TreePanel and displays correctly but in the picker it not displays the text:

My Form:



Ext.define('Tarefas.view.CategoriasForm', {

extend : 'Ext.form.Panel',

layout : 'form',


requires : [
'Ext.ux.TreePicker'

],


xtype: 'categorias-form',


bodyPadding : 10,


items : [{
fieldLabel : 'Título',
name : 'titulo',
xtype : 'textfield'
}, {
fieldLabel : 'Descrição',
name : 'descricao',
xtype : 'textfield'
}, {

fieldLabel : 'Categoria',

xtype : 'treepicker',

store : 'CategoriasTree',

autoScroll: true,
//if initComponent is not called the store is undefined. Bug in 4.x?
initComponent : function() {
this.store = Ext.data.StoreManager.lookup(this.store);
this.callParent(arguments);
}
}],


buttons : [{
text : 'Salvar',
iconCls : 'icon-save',
action : 'salvar-categoria'
}, {
text : 'Cancelar',
iconCls : 'icon-cancel',
action : 'cancelar-categoria'
}]
});


The problem of the scroll can be also seen in the Simple Tasks example, just create a medium tree scructure and you will see that the field not scrolls.

Is there any solution to that?

sergiomichels
13 Aug 2013, 9:04 AM
I've created a fiddle to exemplify: https://fiddle.sencha.com/#fiddle/8g

The TreePanel shows the structure correctly, but the category combobox don't display the text and don't scroll (tested in FF and Chrome).

aaugen
13 Aug 2013, 11:42 PM
Hi,

I don't know why the field not scrolls but for display the node's text, you can use displayField method like this:


}, {
fieldLabel : 'Categoria',
xtype : 'treepicker',
store : Ext.data.StoreManager.lookup('CategoriasTree'),
displayField: 'text',
autoScroll: true
},

sergiomichels
14 Aug 2013, 3:05 AM
Hi Alexandre, thanks for replying.

It indeed solved the issue with the text. The interesting is that the documentation says that Treepicker uses the default of the TreePanel:

Defaults to the default value of {@link Ext.tree.Panel}'s `displayField` configuration.

m.dostal
16 Oct 2013, 2:14 AM
Hi,

in the createPicker method change manageHeight to true to correctly display and scroll the TreePanel.

The best solution would be if TreePicker can have treePanelConfig to override defaults for internally generated TreePanel, for example: rootVisible, useArrows...