代码如下
var cf;
Ext.onReady(function() {
Ext.QuickTips.init(true);
cf = new CountryForm();
cf.render(document.body);
});
CountryForm = Ext.extend(Ext.FormPanel, {
id : 'CountryForm',
title : '查询条件',
frame : true,
width : 1000,
bodyStyle : 'padding:0 10px 0;',
constructor : function(config) {
var countryGroup = {
xtype : "panel",
layout : "form",
columnWidth : 0.5,
labelAlign : "right",
labelWidth : 75,
items : [ {
xtype : 'fieldset',
title : '标题',
autoHeight : true,
layout : 'form',
collapsible : true,
items : [ {
fieldLabel : 'ID',
xtype : 'combo',
mode : 'local',
triggerAction : 'all',
id : 'CountrySearchId',
name : 'CountrySearchId',
displayField:"gender",
store:new Ext.data.SimpleStore({
fields:["gender"],
data:[["Male"],["Female"]]
})
}]
} ],
buttons : [ {
text : 'POP',
onClick : doPop
}]
};
CountryForm.superclass.constructor.call(this, {
items : [ countryGroup ]
})
}
});
function doPop() {
UpdateForm = Ext.extend(Ext.FormPanel, {
id : 'CountryForm',
frame : true,
width : 1000,
bodyStyle : 'padding:0 10px 0;',
constructor : function(config) {
var Country = {
xtype : "panel",
layout : "form",
columnWidth : 0.5,
labelAlign : "right",
labelWidth : 75,
items : [ {
xtype : 'fieldset',
title : 'sub',
autoHeight : true,
layout : 'form',
items : [ {
xtype : 'textfield',
name : 'name',
fieldLabel : 'name'
} ]
} ]
};
UpdateForm.superclass.constructor.call(this, {
items : [ Country ]
})
}
});
ResultWindow = function(config) {
var updateForm = new UpdateForm();
var buttons = new Array();
var buttonClose = {
text : '关闭',
handler : function() {
rw.close();
}
};
buttons = [ buttonClose ];
Ext.apply(this, {
title : '修改画面',
layout : 'fit',
border : false,
width : 450,
height : 380,
minWidth : 450,
minHeight : 380,
maximizable : false,
resizable : false,
constrainHeader : true,
modal : true,
items : updateForm,
buttons : buttons
});
ResultWindow.superclass.constructor.apply(this, arguments);
};
Ext.extend(ResultWindow, Ext.Window);
var rw = new ResultWindow();
rw.show();
}