PDA

View Full Version : Scrollbar doesn't work with autoheight



dobberph
21 May 2013, 3:59 AM
Hello,

in a part of my app (a gridview) the scrollingbar doesn't appear, when I don't set 'height' of the grid (auto-height). If I set the height to any value it works.

Here is a scratch of my code:

Ext.define('BuffetOrga.view.Wasfehltnoch', { extend: 'Ext.grid.Panel',
alias: 'widget.wasfehltnoch',

autoShow: true,
id: 'wasfehltnochView',
autoScroll: true,
title: 'Was fehlt noch?',
scroll: 'vertical',
store: 'Fehlendes',

initComponent: function() {
var me = this;

Ext.applyIf(me, {
viewConfig: {
getRowClass: function(record, rowIndex, rowParams, store) {
var max = record.get('anzahl');
var fehlend = record.get('fehlend');
var da = max - fehlend;

if (da === 0) return 'nothing-row';
else if (fehlend === 0) return 'checked-row';
else return 'normal-row';

}
},
columns: [
{
xtype: 'gridcolumn',
width: 100,
dataIndex: 'party',
text: 'Party'
},
{
xtype: 'gridcolumn',
width: 120,
dataIndex: 'kategorie',
text: 'Kategorie'
},
{
xtype: 'gridcolumn',
width: 110,
dataIndex: 'bezeichnung',
text: 'Bezeichnung'
},
{
xtype: 'numbercolumn',
width: 90,
dataIndex: 'fehlend',
text: 'Es fehlen noch',
format: '0,000'
},
{
xtype: 'numbercolumn',
width: 90,
dataIndex: 'anzahl',
text: 'Insgesamt benötigt',
flex: 1,
format: '0,000'
}
]
});

me.callParent(arguments);
}

});

Does somebody see my fault?

Thanks a lot,
Tobias

evant
21 May 2013, 4:24 AM
You will never see a scrollbar, because auto height means stretch to the size of the content.

dobberph
21 May 2013, 4:49 AM
Hi,

but with about 200 rows as content there should be a possibility to scroll ;D
Nevertheless, is there a possibility to scretch the grid to the maximum and provide a vertical scroll bar?

Thanks a lot,
Tobias

evant
21 May 2013, 4:54 AM
Stretch the grid to a maximum of what? How are you using it?

dobberph
21 May 2013, 5:02 AM
It's in a tabpanel.
And I want it to be stretched to the range of the tabpanel.


{
xtype: 'tabpanel',
region: 'center',
id: 'tabpanel',
activeTab: 0,
items: [
//...
{
xtype: 'wasfehltnoch',
tabConfig: {
xtype: 'tab',
hidden: true
}
}
]

evant
21 May 2013, 5:05 AM
I don't really understand your code. You've got:

a) A panel with no layout, which will be auto -> The "tab"
b) A form with auto layout
c) The grid

Why not just:



{
xtype: 'tabpanel',
// tab panel uses a card layout by default, so it will stretch child items to fit
items: [{
title: 'Foo',
xtype: 'mygrid'
}]
}

dobberph
21 May 2013, 5:08 AM
Yea, sry. I posted some crap. It's above, like you said.

dobberph
22 May 2013, 7:51 AM
But the problem remains as it is.
My code ist as you wroteand no scrollbar is seen.

Thanks,
Tobi