PDA

View Full Version : Last Column of grid not displayed completely



adibhagra
8 Oct 2009, 11:33 PM
hey guys,

i have got a grid and a toolbar within my center regions as follows:

region:'center',
margins:'5 0 5 0',
layout:'anchor',

items : [ myTbar, myGrid ]


these have been created earlier as follows:

var ctext = new Ext.Toolbar.TextItem({
text: cmessage
}) ;
var myTbar = new Ext.Toolbar({
items:ctext,
anchor:'-0.5'
});
var myGrid = new Ext.grid.GridPanel({

title:'Violations',
height:713,
anchor:'-0.5 -0.5',
frame:true,
sm : new Ext.grid.RowSelectionModel({
singleSelect : true,
listeners: {
rowselect: {
fn : function(sm,index,record){

Ext.Msg.alert('You have selected',record.data.id);
}
}
}
}),

store:violations,

columns: [
{header:'Id',dataIndex:'id'},




{header:'Date',dataIndex:'vdate', renderer: Ext.util.Format.dateRenderer('m/d/Y')},
{header:'Type',dataIndex:'type'},
{header:'Amnesty',dataIndex:'amnesty'},
{header:'Resolved',dataiIndex:'resolved'},
{header:'Action',dataIndex:'action'},
{header:'Status',dataIndex:'status'}
],

viewConfig:{forceFit:true}



});



Somehow my last column within the grid called status get partially hidden , as in you can see only the letters 'St' .(its width is reduced)
If i change the order with which i call my grid and toolbar within my center region, then the toolbar is not at all displayed but the grid gets displayed without any problems.

Can anyone tell me where the problem may lie,


thanks,


Ice

Condor
8 Oct 2009, 11:59 PM
Why are you using an anchor layout to put a toolbar over another component? Why not simply specify the toolbar as the tbar?

region:'center',
margins:'5 0 5 0',
layout:'fit',
tbar: myTbar,
items: myGrid

adibhagra
12 Oct 2009, 2:02 AM
thanks condor,

ice