PDA

View Full Version : Vertical scrollbar in gridpanel



janhov
17 Mar 2009, 4:57 AM
My grid is too long for the viewport, so I want a vertical scrollbar:

http://www.toca.no/div/vs.png

I have read through the FAQ, but this is probably too easy for the FAQ..



{
xtype: 'grid',
id: 'grid_gp',
store: gridStore,
columns: [ { header: 'Organisation units ', id: 'name', dataIndex: 'name', sortable: true } ],
autoHeight: true,
autoScroll: true,
width: gridpanel_width,
view: gridView
}

17 Mar 2009, 5:37 AM
remove autoHeight and autoScroll.


your problem is your grid's container is not managing the grid's dimensions properly. Are you using just the form layout in that formPanel ?

mjlecomte
17 Mar 2009, 5:37 AM
You probably want to use layout:'border' for that accordion panel. Put your form in the north region and the grid in the center region with layout:'fit'. Then the grid will add it's own internal scroll bar to just scroll the grid. Basically you want to give the grid some fixed height so it can add a scrollbar.

janhov
17 Mar 2009, 9:17 PM
I removed the autoHeight (of course) and added a fixed height -> the vertical scrollbar appears. But setting a fixed height is not very clever - I want to adjust the grid height to the border below. Someone with a low resolution wouldn't be able to scroll more than half of the list. I guess you get my point.

I was thinking of adjusting it to the <south_frame>.y, but the choropleth widget is created before the viewport, so that won't work.