Ext window:
[code="java"] var addWin = Ext.create('Ext.window.Window', {
title : '角色添加',
id : 'addWin',
layout : "column",
border : false,
autoDestroy : false,
width : 450,
height : 250,
closeAction : 'hide',
plain : true,
modal : true,
constrain : true,
items : addForm
});[/code]
Ext formPanel:
[code="java"]var addForm = Ext.create('Ext.form.Panel', {
title : 'Simple Form',
id : 'addForm',
frame : true,
monitorValid : true,
bodyStyle : 'padding:5px 5px 0',
//layout : 'form',
fieldDefaults : {
labelAlign : 'top',
msgTarget : 'side'
},
//url : ctxpath + '/SystemManager/RoleList',
defaultType : 'textfield',
items : [ {
fieldLabel : '角色编号',
name : 'first',
allowBlank : false
}, {
fieldLabel : '角色名',
name : 'last',
allowBlank : false
} ],
buttons : [ {
text : '重置',
handler : function() {
//addForm.getForm().reset();
}
}, {
text : '提交',
formBind : true, //only enabled once the form is valid
disabled : true,
handler : function() {
// var form = addForm.getForm();
// if (form.isValid()) {
// form.submit( {
// success : function(form, action) {
// Ext.Msg.alert('Success', '1');
// },
// failure : function(form, action) {
// Ext.Msg.alert('Failed', '2');
// }
// });
// }
}
} ]
});[/code]
点击新增时,window可以展示,但是window中的formPanel不能显示。
如图: