PDA

View Full Version : grid layout



lavap
22 Mar 2010, 3:21 AM
Hi...


How to insert the grid layout inside the tabslayout which is in 'center' region.... in the below code...
plz help me in this...

here is my code:



Ext.ns('test');

test.app = function(){


return{

init: function(){

var viewport = new Ext.Viewport({

layout: 'border',

items: [{

region: 'north',

html: 'North',

xtype: 'panel',

height:100,

split: 'true'

},{

region: 'west',

layout:'accordion',

width:300,

items:[{

title: 'pannel1',
autoLoad: 'sw.txt'

},{
title: 'pannel2',
autoLoad: 'dsa.txt' }]


},{

region: 'center',

xtype: 'tabpanel',
activeTab: 1,

items: [{
title: 'SW',
autoLoad :'sw.txt'

},{

title: 'oops',
autoLoad: 'oops.txt'
},{

title:'dsa',

autoLoad:'dsa.txt',

}]

},{

region: 'east',

xtype: 'panel',

html: 'east' ,

split:'true',

width:200


},{

region: 'south',

xtype: 'panel',

html: 'south' ,

split:'true',

height:100

}]});

return viewport
}

};

}();

Condor
22 Mar 2010, 3:32 AM
So you want to add a grid as one of the items of the tabpanel?

Use:

var tabPanel = Ext.getCmp('id-of-tabpanel');
tabPanel.add(grid);
tabPanel.setActiveTab(grid);

lavap
22 Mar 2010, 3:36 AM
thanks for your reply...
but I dont know where I have insert....


can you plz modify the code and send me...

plz do this needfull

lavap
22 Mar 2010, 3:37 AM
thanks for your reply...
but I dont know where I have insert....


can you plz modify the code and send me...

plz do this needfull[/QUOTE]

Condor
22 Mar 2010, 3:52 AM
Why not simply include the grid as one of the items?


{
region: 'center',
items: [{
...
},{
title: 'My grid',
xtype: 'grid',
store: ['One', 'Two', 'Three'],
columns: [{dataIndex: 'field1', header: 'Number'}]
},{
...
}]
}