Boa tarde pessoal,
Bem to começando minha vida com o Extjs, tenho varias telas pra fazer e tenho apanhado bastante, tenho visto a documentaçao e no nosso google de cada dia so que tem certas coisas mto especificas que nao acho ajuda… enfim, to tentando colocar uma grid dentro de um panel e o panel dentro de um viewport, eu consigo fazer apareçer, so que nao consigo dar um tamanho fixo a tela, qdo a grid aumenta ela empurra o outro panel pra baixo, ja tentei colocar width e tudo mas nao adianta…
[code] Ext.onReady(function(){
var ds = new Ext.data.JsonStore({
url : ‘/TesteTagExt/getBooks.do’,
root : ‘first’,
fields : [
‘id’,
‘firstName’,
‘lastName’,
‘coments’
]
});
ds.reload();
var data = Ext.grid.dummyData = [
[1 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
/*[2 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[3 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[4 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[5 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[6 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[7 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[8 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[8 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[9 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[10 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[12 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[13 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[14 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[15 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[16 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[17 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[18 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaa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aaa'],
[242 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[252 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[262 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[272 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[282 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],
[292 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa'],*/
[112 ,'aaaaaaa', 'aaaaaaaa', 'aaaaaaaa']
];
var reader = new Ext.data.ArrayReader({}, [
{name: 'id', type: 'int'},
{name: 'firstName'},
{name: 'lastName'},
{name: 'coments'}
]);
var xg = Ext.grid;
var sm = new xg.CheckboxSelectionModel();
var sm2 = new xg.CheckboxSelectionModel();
var grid = new xg.GridPanel({
id:'button-grid',
autoHeight: true,
autoScroll:true,
store: new Ext.data.Store({
reader: reader,
data: data
}),
cm: new xg.ColumnModel([
sm,
{id:'id',header: "firstName", sortable: true, dataIndex: 'firstName'},
{header: "lastName", sortable: true, dataIndex: 'lastName'},
{header: "coments", sortable: true, dataIndex: 'coments'},
]),
sm: sm2,
viewConfig: {
forceFit:true
},
// inline buttons
/*buttons: [{text:'Save'},{text:'Cancel'}],
buttonAlign:'center',*/
// inline toolbars
tbar:[{
text:'Add Something',
tooltip:'Add a new row',
iconCls:'add'
}, '-', {
text:'Options',
tooltip:'Blah blah blah blaht',
iconCls:'option'
},'-',{
text:'Remove Something',
tooltip:'Remove the selected item',
iconCls:'remove'
}],
region:'center',
// frame:true,
title:'Support for standard Panel features such as framing, buttons and toolbars',
iconCls:'icon-grid'
});
var nav3 = new Ext.Panel({
title: 'Navigation',
region: 'center',
split: true,
height: 300,
autoScroll:true,
collapsible: false,
margins:'1 0 1 1',
cmargins:'1 1 1 1'
});
var nav2 = new Ext.Panel({
title: 'Navigation',
region: 'center',
layout:'fit',
iconCls: 'plus',
closeAction:'hide',
plain: true,
closable :true,
items:[grid, nav3]
});
var nav = new Ext.Panel({
title: 'Navigation',
region: 'west',
split: true,
width:300,
collapsible: false,
margins:'1 0 1 1',
cmargins:'1 1 1 1'
//items: Tree
});
new Ext.Viewport({
layout:'border',
autoHeight: true,
autoScroll:true,
items: [nav, nav2]
});
});[/code]
[quote]
[/quote]se alguer puder me ajudar eu ficaria mtooooooooooo grato… vlu pessoal … força sempre