PDA

View Full Version : Like to have vetical scrollbars in a grid panel



LarsVern
21 Nov 2011, 7:59 AM
Hi,

I have got a grid in a grid.panel dockedItem. So that I have got two grids. In the first I have got a list and in the dockedItems I have got such a summary row. These secound grid should be only one row and shown everytime, so that I can scroll the grid on top and always the summery to take a look.

It works fine:



Ext.define('AM.view.vGrid', {
extend: 'Ext.grid.GridPanel'
, alias: 'widget.boardgrid'
, width: 788
, height: 296
, layout: 'fit'
, store: myStore
, disableSelection: true
, columns: myHeader
, hideHeaders: false
, scroll: true
// , 'overflow-y': 'scroll'
, dockedItems: [{
xtype: 'grid'
, id: 'summary'
, dock: 'bottom'
, displayinfo: true
, store: myStore
, width: 788
, height: 25
, layout: 'fit'
, hideHeaders: true
}]



My problem are these scrollbars. In the first grid I have a scrollbar because there are a lot of rows in. In the summary grid row I don't have a scrollbar, so the cells are placed with differend width numbers. But I like to have the same width for each column, even it is in the top or in the bottom grid.

You see, I tryed it with some ccs code, I can display a scrollbar, but the width of the cells are still the same, the lines of the columns are not in one line.

Is it possible to display a real scrollbar for everytime...?

greetings
Lars

mitchellsimoens
21 Nov 2011, 9:06 AM
Have you tried adding the CSS to the grid:


overflow-y: scroll;

LarsVern
21 Nov 2011, 9:14 AM
Hi,

thanks for the answare. Yes, I have tryed - like you can see in my code.

The scrollbar will be shown, but it will not use the space. For my summary row the last content will be covered by the scrollbar. So the columns in the bottom grid don't have the same width like the grid on the top.

Just show the scrollbar is not enough, I need to have scrollbars that take also that space they need and push the columns for that, so that I have the same width in both grids.

greetings
Lars

mitchellsimoens
21 Nov 2011, 9:27 AM
Are you using 4.0.7 or before? In 4.1 the native scrollbars are back.

LarsVern
21 Nov 2011, 10:02 AM
Hi,

I am using Ext JS 4.0.2, so I will try to use the 4.1 and let you know what happend.

greetings
Lars

LarsVern
24 Nov 2011, 1:20 AM
Hi,

I tryed to use Ext JS 4.1 - but it's not running at all...

I downloaded the version Ext JS 4.1 Performance Preview (http://cdn.sencha.io/ext-4.1-pr1.zip).

So I don't have an idear if that with the scrollbar will be better in that version.

Any other tips...?