Boa tarde pessoal,
Entao estou começando com extjs e to apanhando bastante, tenho lido documentação visto exemplos mas tenho apanhado bastante na parte de layout… no caso por exemplo se eu pego uma grid(com json) e jogo dentro de um viewport, tudo funciona lindo, mas se eu pego a grid e coloco dentro de um panel e o panel dentro de um viewport ai ja começa a dar xabú em tudo.
this.layout.setActiveItem is not a function
[Break on this error] Ext.Container=Ext.extend(Ext.BoxComponent,{autoDestroy:true,defaultType:“panel”,…
essa é a critica, segue o codigo abaixo, se alguem puder me ajudar eu agradeceria MUITOOOOOOOOOOOOOOO tenho uma janela super complexa pra fazer aqui no trabalho e nao consigo sair de um layout…
[code]Ext.onReady(function(){
var ds = new Ext.data.JsonStore({
url : ‘/TesteTagExt/getBooks.do’,
root : ‘first’,
fields : [
‘id’,
‘firstName’,
‘lastName’,
‘coments’
]
});
ds.reload();
var xg = Ext.grid;
var sm = new xg.CheckboxSelectionModel();
var sm2 = new xg.CheckboxSelectionModel();
var grid = new xg.GridPanel({
id:'button-grid',
store: ds,
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 nav2 = new Ext.Panel({
title: 'Navigation',
region: 'center',
split: true,
collapsible: true,
margins:'1 0 1 1',
cmargins:'1 1 1 1',
items: grid
});
var nav = new Ext.Panel({
title: 'Navigation',
region: 'west',
split: true,
collapsible: false,
width: 300,
//height:500,
margins:'1 0 1 1',
cmargins:'1 1 1 1',
// items: grid
});
new Ext.Viewport({
layout: 'border',
defaults: {
activeItem: 0
},
items: [nav, nav2]
});
});[/code]