PDA

View Full Version : Need Horizontal scroll bar in my grid ... very urgent !!



babai
30 Apr 2010, 5:03 AM
Hi,
I am unable to induce horizontal scrollbar in my grid. As a result the rendered grid does not show few columns. Its urgent pls help.

Here goes my code -
/*** Store ***************************/
ds = new Ext.data.Store({
id: 'ds',
proxy: new Ext.data.HttpProxy({
url: 'data.jsp',
method: 'POST'
}),
baseParams:{task: "LISTING",name: name}, // this parameter is passed for any HTTP request
reader: new Ext.data.JsonReader({
root: 'results',
totalProperty: 'total',
id: 'id'
},[
{name: 'c1', type: 'string', mapping: 'c1'},
{name: 'c2', type: 'string', mapping: 'c2'},
{name: 'c3', type: 'string', mapping: 'c3'},
{name: 'c4', type: 'float', mapping: 'c4'},
{name: 'c5', type: 'float', mapping: 'c5'}
]),
sortInfo:{field: 'IDpresident', direction: "ASC"}
});

dm = new Ext.grid.ColumnModel(
[{
header: 'Acct',
readOnly: true,
dataIndex: 'c1',
width: 130,
height: 50,
hidden: false
,sortable: true
},{
header: 'Title',
dataIndex: 'c2',
width: 130
,sortable: true
},{
header: 'Type',
dataIndex: 'c3',
width: 130
,sortable: true
},{
header: 'Units',
readOnly: true,
dataIndex: 'c4',
width: 130,
hidden: false
,sortable: true
},{
header: 'col1',
dataIndex: 'c4',
width: 130,
readOnly: false
,sortable: true
},{
header: 'col2',
dataIndex: 'c4',
width: 130,
readOnly: false
,sortable: true
},{
header: 'col3',
dataIndex: 'c4',
width: 130,
readOnly: false
,sortable: true
},{
header: 'col4',
dataIndex: 'c4',
width: 130,
readOnly: false
,sortable: true
}
]
);
dm.defaultSortable= true;

/****Panel ******************/
{
xtype: 'fieldset',
title: 'Projections',
layout: 'form',
colspan: 5,
autoWidth:true,
autoHeight:true,
autoScroll:true,
height: 300,
border: false,
items: [
{
id: 'grid',
xtype: 'grid',
title: '',
height: 132,
autoWidth:true,
store: ds,
autoScroll:true,
cm: dc
}
]
}

Animal
30 Apr 2010, 5:09 AM
Format your code.

But the answer is: Size the GridPanel.

babai
1 May 2010, 5:24 AM
It worked ....
thanks for the reply.
cheers.