PDA

View Full Version : GridPanel in a FormPanel, formatted



xandeq
9 Oct 2011, 6:00 PM
Hi,

I have a GridPanel, that shows data from the next football match.
But im using a GridPanel and its showing in columns.
How can i use a FormPanel in order to format the fields something like:
Team 1 x Team 2
10:30

My code:


Ext.onReady(function () {
StoreJogos = new Ext.data.JsonStore({
url: '../Jogos/ListarProximoJogo',
root: 'dados',
fields: ['id', 'timeA', 'timeB', 'horario', 'dia', 'resultadoA', 'resultadoB'],
totalProperty: 'dados',
id: 'id',
autoLoad: true
});

StoreJogos.load({ params: { start: 0, limit: 20} });

var grid = new Ext.grid.GridPanel({
store: StoreJogos,
columns: [
{ width: 50, dataIndex: 'timeA' },
{ width: 50, dataIndex: 'timeB' },
{ width: 30, dataIndex: 'horario' },
{ width: 30, dataIndex: 'dia' }],
stripeRows: true,
height: 200,
autoWidth: true,
title: 'Próximo jogo',
// config options for stateful behavior
stateful: true,
stateId: 'grid',
viewConfig: { forceFit: true },
renderTo: 'proximo-jogo'
});
});


Thank you !