Tengo un tabpanel. En la pestaña, tengo un panel que incluye una barra de herramientas y 3 elementos: [fieldset, un gridpanel y otro fieldset (o algunos botones)]. No puedo hacer que el panel de red muestre la barra de desplazamiento. Solo funciona si configuro el maxheight/minheight del gridpanel.
También intenté envolviendo el panel de la red dentro de un contenedor. Sin suerte. En el ejemplo, uso el diseño de ajuste. Intenté el diseño de "ancla" y asigné anclaje: "100% 50%" al gridpanel, con la esperanza de que cambiaría de tamaño cuando cambiara el tamaño del navegador. Sin suerte.extjs gridpanel dentro de un panel no desplazamiento automático o cambio de tamaño
Alternativamente, si gridpanel es el ÚNICO elemento en la pestaña, el desplazamiento automático funcionaría. Entonces aparece cuando está dentro de otro panel, el desplazamiento automático/cambio de tamaño no funciona.
¿Extraño algo aquí?
Ext.application({
name: 'MyApp',
launch: function() {
// create the data store
var d = ['company', 100];
var myData = [];
for (var i = 0; i < 50; i++) {
myData[i] = d;
}
var store = Ext.create('Ext.data.ArrayStore', {
fields: [{
name: 'company'
}, {
name: 'price',
type: 'float'
}],
data: myData
});
Ext.create("Ext.container.Viewport", {
layout: {
type: 'border'
},
items: [{
xtype: 'toolbar',
id: 'headerbar',
region: 'north',
height: 30
}, {
xtype: 'toolbar',
id: 'menubar',
region: 'north',
height: 30
}, {
xtype: 'tabpanel',
itemId: 'maintabpanel',
activeTab: 0,
region: 'center',
plain: true,
margins: '5 5 5 5',
layout: 'fit',
items: [{
closable: false,
title: 'Tab',
margins: '0 0 0 0',
items: [{
xtype: 'panel',
title: 'Panel',
layout: 'fit',
tools: [{
type: 'help',
tooltip: 'Help'
}, {
type: 'close',
tooltip: 'Close'
}],
items: [{
xtype: 'fieldset',
title: 'Field Set',
layout: 'hbox',
items: [{
xtype: 'textfield',
fieldLabel: 'Input'
}]
}, {
xtype: 'gridpanel',
autoScroll: true,
store: store,
columns: [{
text: 'Company',
flex: 1,
sortable: true,
dataIndex: 'company'
}, {
text: 'Price',
flex: 1,
sortable: true,
dataIndex: 'price'
}],
viewConfig: {
autoFit: true
}
}, {
xtype: 'fieldset',
title: 'Field Set 2',
layout: 'hbox',
items: [{
xtype: 'textfield',
fieldLabel: 'Output'
}]
}]
}]
}]
}, {
xtype: 'box',
id: 'footer',
region: 'south',
html: '<h1> Copyright 2012</h1>',
height: 30
}]
});
}
});
¿Encontró una solución a su problema? – Elias