контейнер создавать это лишнее, можно прямо грид запихнуть.
Вот пример:
Ext.onReady(function(){
viewport = Ext.create('Ext.Viewport', {
id: 'layout',
layout:'border',
items:[
{
region:'center',
html:'smth'
},
getGrid()
]
});
});
function getGrid(){
var myData = [
['3m Co', 71.72, 0.02, 0.03, '9/1 12:00am'],
['Alcoa Inc', 29.01, 0.42, 1.47, '9/1 12:00am'],
['Altria Group Inc', 83.81, 0.28, 0.34, '9/1 12:00am']
];
var store = Ext.create('Ext.data.ArrayStore', {
fields: [
{name: 'company'},
{name: 'price', type: 'float'},
{name: 'change', type: 'float'},
{name: 'pctChange', type: 'float'},
{name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
],
data: myData
});
var grid = Ext.create('Ext.grid.Panel', {
region: 'east',
hideCollapseTool: true,
store: store,
columnLines: true,
columns: [
{
text : 'Company',
flex : 1,
sortable : false,
dataIndex: 'company'
},
{
text : 'Price',
width : 75,
sortable : true,
dataIndex: 'price'
},
{
text : 'Change',
width : 75,
sortable : true,
dataIndex: 'change'
},
{
text : '% Change',
width : 75,
sortable : true,
dataIndex: 'pctChange'
},
{
text : 'Last Updated',
width : 85,
sortable : true,
dataIndex: 'lastChange'
}
],
title: 'Array Grid (Click header to collapse)',
viewConfig: {
stripeRows: true
}
});
return grid;
}