代码如下:
[code="java"]
var funWin = Ext.extend(Ext.Window ,{
title : '功能模块',
width : 400,
autoHeight : true,
layout : 'fit',
closeAction : 'hide',
initComponent : function(){
Ext.seven.base.funWin.superclass.initComponent.call(this);
this.form = new Ext.form.FormPanel({
autoHeight : true,
frame : true,
defaults :{
autoHeight : true,
collapsible : true
},
defaultType : 'fieldset',
bodyStyle : 'padding : 20px 10px',
items : [{
title : '存档本年工作',
items : [{
xtype : 'label',
hideLabel : true,
html : "<font style='{font-size : 13px;color: red;'>注意:</font>" +
"<font style='{font-size : 13px;color:#006400}'>该功能要在本年毕业论文(设计)全部完成后才能执行,执行后本年论文将变成往届学生论文,就可以开始筹备下一年的毕业论文(设计)的管理工作!</font>"
},{
xtype : 'form',
labelWidth : 100,
labelAlign : 'right',
defaultType : 'numberfield',
bodyStyle : 'padding : 15px',
defaults : {width : 100},
items : [{
fieldLabel : '年 份'
},{
xtype : 'label',
hideLabel : true,
html : '<img src="imgcode.jsp" />',
cls : 'labelCode'
},{
fieldLabel : '验证码'
},{
xtype : 'button',
text : '确认',
width : 70,
iconCls : 'lock',
cls : 'funBut',
scope : this,
handler : function(){
//取出数据
var year = this.form.get(0).get(1).get(0).getValue();
var code = this.form.get(0).get(1).get(2).getValue();
if(year == ''){
Ext.Msg.alert('提示','年份不能为空!');
return false;
}
if(code == ''){
Ext.Msg.alert('提示','验证码不能为空!');
return false;
}
//先判断年份输入的是不是正确的
Ext.Ajax.request({
url : 'ThesisTitle-judgeYear',
method : 'post',
params : {
year : year,
code : code
},
scope : this,
success : function(response , options){
var json = Ext.decode(response.responseText);
if(json.success){
var flag = json.flag;
//判断 code是否正确
if(flag=='code'){
Ext.Msg.alert('提示','输入的验证码有误!');
}else if(flag=='year'){
Ext.Msg.alert('提示','输入的年份有误!');
}else{
Ext.Msg.confirm('提示','确定要执行此功能吗?',function(but){
if(but=='yes'){
Ext.Ajax.request({
url : 'ThesisTitle-clean',
method : 'post',
params : {year : year},
scope : this,
success : function(response ,options ){
var json = Ext.decode(response.responseText);
if(json.success){
Ext.Msg.alert('提示','操作成功!');
}else{
Ext.Msg.alert('提示','操作失败!');
}
},
failure : function(response , options){
Ext.Msg.alert('提示','操作失败!');
}
});
}
},this);
}
}else{
Ext.Msg.alert('提示','操作失败!');
}
},
failure : function(response , options){
Ext.Msg.alert('提示','操作失败!');
}
});
}
}]
}]
}]
});
this.add(this.form);
}
});
new funWin().show();
[/code]
在firefox下的效果:
[img]http://dl.iteye.com/upload/attachment/564082/f8d1d1e5-5a9a-3c3d-b1a1-83b70aeefbf4.jpg[/img]
在IE下报的错误:
[img]http://dl.iteye.com/upload/attachment/564084/b97cc7b8-0d62-3b6f-95d2-d2febe7fbe15.jpg[/img]
有没同仁遇见过这样的问题的啊 !
求解释 :