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 : 'form',
border:false,
hidden:true,
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);
}
}
}
}]
},{
xtype : 'form',
layout : 'column',
region : 'north',
// height : 30,
items :[{
xtype : 'combobox',
fieldLabel : '绑定中间件类型',
value : '数据储存服务',
width : 250
},{
xtype : 'combobox',
value : 'oracle',
width : 100
},{
xtype : 'button',
text : '创建oracle',
width : 150,
height : 30
},{
xtype : 'grid',
store: {
fields:['appSource', 'cloudSource'],
data:[
{ 'appSource': 'Oracle1', "cloudSource":"C1" },
{ 'appSource': 'Oracle2', "cloudSource":"C2"},
{ 'appSource': 'Oracle3', "cloudSource":"C3"},
{ 'appSource': 'Oracle4', "cloudSource":"C4"}
]
},
columns: [
{ header: '应用数据源', dataIndex: 'appSource',flex : 1 },
{ header: '云平台数据源', dataIndex: 'cloudSource', flex: 1 }
],
width: 400
}]
}
],
dockedItems :[{
xtype : 'toolbar',
dock : 'bottom',
items :[{
text : '上一步'
},'->',{
text : '下一步'
}]
}]
}).show();
});