包括TabPanel、GridPanel、FormPanle、TreePanel
我做的第一个panel
/**
*
*/
Ext.onReady(function(){
Ext.create('Ext.window.Window', {
title: 'Hello',
height: 400,
width: 400,
border:false,
padding:'0 0 0 0',
header : false,
shadow : false,
layout: 'fit',
bodyStyle:"background-color:#000fff",
items : [{
xtype : 'panel',
title : '创建应用',
tools : [{
type : 'close'
}],
items : [{
xtype : 'form',
items :[{
xtype : 'textfield',
fieldLabel : '模板名称',
labelAlign : 'right',
value : '轻量级web应用'
},{
xtype : 'combobox',
fieldLabel : 'Domains',
labelAlign : 'right',
value : 'clouds.io'
},{
xtype : 'combobox',
fieldLabel : '内存大小',
labelAlign : 'right',
value : '256m'
},{
xtype : 'textfield',
fieldLabel : '运行时环境',
labelAlign : 'right',
value : 'tomcat'
},{
xtype : 'textfield',
fieldLabel : '数据储存服务',
labelAlign : 'right',
value : 'mysql oracle'
},{
xtype : 'textfield',
fieldLabel : '数据分析服务',
labelAlign : 'right',
value : '流数据'
},{
xtype : 'textfield',
fieldLabel : '应用服务',
labelAlign : 'right',
value : '消息中间件'
},{
xtype : 'fieldset',
layout : 'column',
items : [{
xtype :'combobox',
fieldLabel : '创建位置',
labelAlign : 'right',
value : 'org1',
width : 250
},{
xtype : 'combobox',
value : 'space1',
width : 120
}]
},{
xtype : 'textfield',
fieldLabel : '应用名称',
value : 'Que sera',
labelAlign : 'right'
},{
xtype : 'radiogroup',
fieldLabel : '上传文件',
id : 'upload',
labelAlign : 'right',
columns : 1,
items :[
{ boxLabel: '上传本地文件', name: 'rb', inputValue: '1' },
{
xtype : 'filefield',
hidden : true,
id : 'uploadFile',
width : 280
},
// { xtype : 'textfield',hidden : true,id : 'uploadFile'},
{ boxLabel: '上传模板应用', name: 'rb', inputValue: '2' },
{
xtype : 'filefield',
hidden : true,
id : 'uploadTemplate',
width : 280
}
],
listeners :{
change : function(){
var obj=Ext.getCmp('upload').items.items;
console.log(obj);
if(obj[0].checked){
var com=Ext.getCmp('uploadFile');
com.setVisible(true);
com=Ext.getCmp('uploadTemplate');
com.setVisible(false);
}else if(obj[2].checked){
var com=Ext.getCmp('uploadFile');
com.setVisible(false);
com=Ext.getCmp('uploadTemplate');
com.setVisible(true);
}
}
}
}]
}],
dockedItems :[{
xtype : 'toolbar',
dock : 'bottom',
items :[{
text : '上一步'
},'->',{
text : '下一步'
}]
}]
}]
}).show();
});