전체 페이지에 대해 BorderLayout이있는 곳에 앱을 작성하고 있습니다. 남쪽 부분에는 FormPanels을 추가하는 Panel이 있습니다. FormPanels을 스크롤 할 수 있도록 해당 패널을 스크롤 할 수 있어야합니다.ExtJS : 패널에 세로 모양 자동 스크롤 추가됨
지금까지 검색에서 찾은 것은 아무 것도 도움이되지 않았습니다. ExtJS가 LayoutManager의 조합, 크기 설정 및 AutoScroll 설정과 관련하여 무엇을 요구하는지 잘 모르겠습니다.
감사의 말을들을 수 있습니다.
코드 조각 : 그것은 autoScroll:true
을해야하고 그것으로 양식 및 그리드를 모두 추가해야하므로
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();
}
matchingTrailJunctionsPanel이 테두리 레이아웃의 일부인 경우 지역 값을 설정해야합니다. 테두리 레이아웃에는 '가운데'영역도 있어야합니다. 전체 코드를 게시 할 수 있습니까? –
요청에 따라 더 많은 코드를 포함 시켰습니다. 포함 패널 인 matchedTrailJunctionsPanel에 높이를 설정하면 스크롤바가 표시된다는 것을 발견했습니다. 그러나 GridPanel을 포함하면 작업이 혼란스럽고 GridPanel은 다음 패널을 숨 깁니다. – Sarge