我正在寫一個應用程序,我有一個BorderLayout整個頁面。在南部我有一個面板,我添加FormPanels。我希望能夠滾動該面板,以便可以滾動瀏覽FormPanel。ExtJS:自動滾動垂直FormPanels添加到面板
到目前爲止,我從搜索中找到的東西都沒有幫助。我不太瞭解ExtJS在佈局管理器組合,設置大小和設置AutoScroll方面的要求。
任何部分提示將不勝感激地跟進。
的代碼段:
new Ext.Viewport({
layout: "border",
items: [{
region: "north",
contentEl: "title",
height: 50
}, {
region: "center",
id: "mappanel",
title: "Map",
xtype: "gx_mappanel",
map: map,
layers: [layer],
extent: extent,
split: true,
tbar: toolbarItems
}, {
region: "east",
title: "Details",
width: 300,
split: true,
id: "east-panel",
laout: 'fit'
}, {
region: "south",
id: "south-panel",
height: 200
}, {
region: "west",
id: "west-panel",
width: 300
}]
});
matchedTrailJunctionsPanel = new Ext.Panel({
title: "Matched Trail Junctions2",
id: "matched-trail-junctions",
autoScroll:true
//layout: 'anchor'
});
var southPanel = Ext.getCmp('south-panel');
southPanel.add(matchedTrailJunctionsPanel);
southPanel.doLayout();
createTrailJunctionPanel = function(trailJunction) {
var trailJunctionPanel = new Ext.form.FormPanel({
labelWidth: 75,
width: 350,
defaultType: 'textfield',
items: [{
fieldLabel: 'Junction Name',
name: 'junction-name'
}],
autoScroll:true,
//anchor: '100% 100%',
height: 100
});
matchedTrailJunctionsPanel.add(trailJunctionPanel);
if(trailJunction.publicTrailSegments.length == 0) {
matchedTrailJunctionsPanel.add(new Ext.form.Label({text: 'No public trails matched'}));
} else {
var grid = new Ext.grid.GridPanel({
store: mapMatchObjectStore,
columns: [
{id:'publicTrailSegment',header: 'Trail', width: 160, sortable: true, dataIndex: 'publicTrailSegment'}
],
stripeRows: true,
autoExpandColumn: 'publicTrailSegment',
height: 350,
width: 600,
title: 'Matched Trail Junctions'
});
matchedTrailJunctionsPanel.add(grid);
}
matchedTrailJunctionsPanel.doLayout();
}
如果matchedTrailJunctionsPanel是邊框佈局的一部分,則需要設置區域值。邊界佈局也必須具有「中心」區域。你能發佈整個代碼嗎? – 2010-04-05 17:07:37
我已根據要求包含更多代碼。我發現在包含面板上設置高度,matchedTrailJunctionsPanel顯示滾動條。但是,包括GridPanel會混淆事物並且GridPanel會隱藏任何後面的面板。 – Sarge 2010-04-05 17:38:44