PDA

View Full Version : Grid with other grids as rows



brunoferoleto
12 Apr 2012, 5:20 AM
Is there a way that the rows of my grid can be other grids?

Like this:



...
var itens = [];
...
// Inside a loop
{
itens.push(
{
gridsubGrp:
Ext.create('EGPE.view.GridSubGrupoNovo',{
descricaoSubGrupo: sbgrp.data.descricaoSubGrupo,
subGrupoData: sbgrp.data,
store: Ext.create('Ext.data.ArrayStore', {
model: 'EGPE.model.ModelLinhaValores',
data: dadosLinha
})
}),
grupo: grp.data.descricaoGrupo
}
);
} // end of loop
...
Ext.create('Ext.grid.Panel',{
store: Ext.create('Ext.data.Store', {
fields: ['gridsubGrp','grupo'],
data: itens,
groupField: 'grupo'
}),
features: [{
id: 'group',
ftype: 'groupingsummary',
groupHeaderTpl: '{name}',
hideGroupedHeader: true,
enableGroupingMenu: false
}],
columns: [
{
header: 'grupo',
sortable: true,
dataIndex: 'grupo'
},
{
header: 'gridsubGrp',
dataIndex: 'gridsubGrp'
}
]
})

brunoferoleto
12 Apr 2012, 5:22 AM
By the way
EGPE.view.GridSubGrupoNovo extends 'Ext.grid.Panel'