如题
Ext window代码:
   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
});Ext formPanel代码:
   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');
// }
// });
// }
}
} ]
});点击新增addWin能弹出来,但是addWin中的formPanel不能显示。
extjs4JavaScript