【发布时间】:2011-01-26 05:34:00
【问题描述】:
使用 ExtJs。
我正在尝试设计一个主面板,它分为三个子面板(树列表、网格和面板)。它的工作方式是您有一个包含元素的树列表(西),单击填充网格(中心)的元素,然后单击网格中的一个元素并生成面板(西)。
包含其他三个面板的主面板已定义为布局“边框”。
现在我面临的问题是中心布局(网格)已在代码中定义为固定宽度,而西面板则定义为自动宽度。但是当界面生成时,网格宽度突然占据了界面中的所有空间,而不是西面板。
代码如下:
var exploits_details_panel = new Ext.Panel({
region: 'east',
autoWidth: true,
autoScroll: true,
html: 'test'
});
var exploit_commands = new Ext.grid.GridPanel({
store: new Ext.data.Store({
autoDestroy: true
}),
sortable: true,
autoWidth: false,
region: 'center',
stripeRows: true,
autoScroll: true,
border: true,
width: 225,
columns: [
{header: 'command', width: 150, sortable: true},
{header: 'date', width: 70, sortable: true}
]
});
var exploits_tree = new Ext.tree.TreePanel({
border: true,
region: 'west',
width: 200,
useArrows: true,
autoScroll: true,
animate: true,
containerScroll: true,
rootVisible: false,
root: {nodeType: 'async'},
dataUrl: '/ui/modules/select/exploits/tree',
listeners: {
'click': function(node) {
}
}
});
var exploits = new Ext.Panel({
id: 'beef-configuration-exploits',
title: 'Auto-Exploit',
region: 'center',
split: true,
autoScroll: true,
layout: {
type: 'border',
padding: '5',
align: 'left'
},
items: [exploits_tree, exploit_commands, exploits_details_panel]
});
这里的“var exploits”是我的主面板,包含其他三个子面板。
“exploits_tree”是包含一些元素的树列表。当您单击其中一个元素时,将填充网格“exploit_commands”,当您单击其中一个填充元素时,将生成“exploits_details_panel”面板。
如何在“exploit_commands”上设置固定宽度?
感谢您的宝贵时间。
【问题讨论】:
标签: javascript layout extjs height panel