PDA

View Full Version : GridPanel Scroll doesn't work



daniel_
19 May 2011, 12:25 PM
hello

AutoScroll doesn't work with the gridPanel. if i specify a specific height and the content is bigger i get just the name of the columns
26148 (http://osgeo-org.1803224.n2.nabble.com/file/n6383275/Capturer.jpg)

this is the code:


var hopitaux_Grid = new Ext.grid.GridPanel
({
title: 'Basic Grid Panel with Ext JS and PHP',
height: 250,
autoScroll: true,
frame: true,
store: store_hopitaux,
colModel: new Ext.grid.ColumnModel({

columns: [
{header: 'nom_hopital', dataIndex: 'nom_hopital', id: 'nom_hopital'},
{header: 'statut_hopital', dataIndex: 'statut_hopital'},
{header: 'niveau_hopital', dataIndex: 'niveau_hopital'},
{header: 'nbr_consult_total', dataIndex: 'nbr_consult_total'}
]
})
});the gridPanel is in a panel table wich is in a viewport Panel:


dashBoardPanel = new Ext.Panel
({
id: 'main-panel',
region: 'center',
border: true,
autoScroll: true,
layout: {
type: 'table',
columns: 2
},
defaults: { height: 285 },
items:[mapPanelDashBoard, hopitaux_Grid]

});
NB: i'm using FireFox 3.6.17
Thank you very much for the help

daniel_
21 May 2011, 1:19 PM
Any Help please !!!!! i don't find the solution. Please help me !!!

drian
21 May 2011, 1:29 PM
what exactly do you want to achieve? a screenshot with what you want would be helpful also.

daniel_
22 May 2011, 3:07 AM
Thank you for the reply. I want to get the scroll in the gridPanel. 26199. The problem is: when i specify the height of the grid, i get 26200. So i want to get a normal gridPanel with scroll.

The situation is: i put the gridPanel in a panel (with table layout manager) wich is in a viewPort.

this code gives me : 26200 but i want 26199 with scroll when there is many rows :



var hopitaux_Grid = new Ext.grid.GridPanel
({
title: 'Basic Grid Panel with Ext JS and PHP',
height: 250,
autoScroll: true,
frame: true,
store: store_hopitaux,
colModel: new Ext.grid.ColumnModel({

columns: [
{header: 'nom_hopital', dataIndex: 'nom_hopital', id: 'nom_hopital'},
{header: 'statut_hopital', dataIndex: 'statut_hopital'},
{header: 'niveau_hopital', dataIndex: 'niveau_hopital'},
{header: 'nbr_consult_total', dataIndex: 'nbr_consult_total'}
]
})
});



dashBoardPanel = new Ext.Panel
({
id: 'main-panel',
region: 'center',
border: true,
autoScroll: true,
layout: {
type: 'table',
columns: 2
},
defaults: { height: 285 },
items:[mapPanelDashBoard, hopitaux_Grid]

});

i'm using FireFox 3.6.17

Thank you for the help

drian
22 May 2011, 5:07 AM
Never used table layout before :). I usually use vbox/hbox as it's more flexible. The gridpanel will automatically use autoscroll if the number of rows don't fit the height of the panel.

I suggest you try Ext Designer and try your layouts there, it will help you immensely.

daniel_
22 May 2011, 5:09 AM
Ok, thank you. with vbox/hbox can i get the same result like table ?