PDA

View Full Version : Problem to show button on tbar in GridPanel



leidsonmelo
6 Jun 2011, 5:02 AM
I'm having trouble to show a button on tbar in GridPanel.

My GridPanel is hidden: true, when i show the grid, the button does not appear.


var botaoAdicionarServicoTerceiroTab = new Ext.Button({
text : 'Adicionar',
tooltip : 'Adicionar Servišo de Terceiro',
iconCls : 'icon-add',
fieldLabel: ' ',
labelSeparator: ' ',
handler : function() {
windowModalServicosTerceiros.show();
}
});


var gridServicoTerceiros = new Ext.grid.GridPanel({
title: 'Servišo de Terceiros',
iconCls : 'icon-grid',
height : 200,
frame : true,
tbar: [botaoAdicionarServicoTerceiroTab],
columns : [
new Ext.grid.Column({
header : 'Servišo',
width : 250,
dataIndex : 'servico',
sortable : true
}),
new Ext.grid.Column({
header : 'Valor (R$)',
width : 80,
dataIndex : 'valorServicoTerceiro',
sortable : true
}),
new Ext.grid.Column({
header : 'Data Inicial',
width : 130,
dataIndex : 'dataInicialServicoTerceiro',
sortable : true
}),
new Ext.grid.Column({
header : 'Data Final',
width : 130,
dataIndex : 'dataFinalServicoTerceiro',
sortable : true
})
],
store : store
});

skirtle
6 Jun 2011, 7:03 PM
Works fine for me. How are you hiding it and showing it? What layout are you using on the owner of the grid?

leidsonmelo
7 Jun 2011, 5:48 AM
The grid is in a Container in a TabPanel. So, a hide a Container.