extjs动态向panel如何嵌套panel

2025-02-25 10:41:02
推荐回答(2个)
回答1:

Ext.namespace('DF.tjxs');

/**
* 配电设备
*
*/
DF.tjxs.pwsbPanel = function(config) {
// 定义成员变量 及方法
var cb = new Ext.form.ComboBox({
// all of your config options
// fieldLabel: '月份',
//
// listeners:{
// scope: this
//// 'select': yourFunction
// }
});

var toolbarPanel = new Ext.Panel({
// title : '工具栏面板',
region : 'north' ,
height : 40,
items :[cb]
});
var pwsbTreePanel = new Ext.Panel({
// title : '配网设备列表',
region : 'west' ,
width : 200,
minSize : 100,
maxSize : 300
});
var pwsbEditPanel = new Ext.Panel({
// title : '编辑功能面板',
region : 'center',
height : 100
});

var innerPanel = new Ext.Panel({
title : '配网设备管理',
region : 'center',
margins : '5 0 0 0',
layout : 'border',
width : 500,
height : 600,
items : [toolbarPanel,pwsbTreePanel, pwsbEditPanel]

});

// 调用构造函数

DF.tjxs.pwsbPanel.superclass.constructor.call(this, {
layout: 'border',
title : '配网设备',
closable : true,
scope : this,
items : [innerPanel]
});
Ext.apply(this, config);
};

Ext.extend(DF.tjxs.pwsbPanel, Ext.Panel, {

});

回答2:

var panel_outer = new Ext.Panel();var panel_one = new Ext.Panel();panel_outer.add(panel_one);panel_outer.doLayout();