怎样将extjs3的写法转换成extjs4

燕飞残月天 2016-04-18 10:42:36
Ext.QuickTips.init();
LoginWindow = Ext.extend(Ext.Window, {
renderTo : 'loginWin',
title : '系统登录',
width : 265,
height : 160,
closable : false,
draggable : false,
resizable : false,
defaults : {
border : false
},
buttonAlign : 'center',
createFormPanel : function() {
return new Ext.form.FormPanel({
bodyStyle : 'padding-top:6px',
defaultType : 'textfield',
labelAlign : 'right',
labelWidth : 55,
labelPad : 0,
frame : true,
defaults : {
allowBlank : false,
width : 158
},
items : [{
cls : 'user',
name : 'userName',
fieldLabel : '帐号',
blankText : '帐号不能为空'
}, {
cls : 'key',
name : 'password',
fieldLabel : '密码',
blankText : '密码不能为空',
inputType : 'password'
},{
id:"randCode",
name:"randCode",
width:70,
fieldLabel:"验证码",
allowBlank:false,
blankText:"验证码必须输入"
}]
});
},
login : function() {
if (this.fp.form.isValid()) {
this.fp.form.submit({
waitTitle : '请稍候',
waitMsg : '正在登录......',
url : 'login.do?actionType=doLogin',
success : function(form, action) {
window.location.href = 'main.jsp';
},
failure : function(form, action) {
form.reset();
Ext.Msg.alert('警告', action.result.msg);
}
});
}
},
initComponent : function() {
LoginWindow.superclass.initComponent.call(this);
this.fp = this.createFormPanel();
this.add(this.fp);
this.addButton('登录', this.login, this);
this.addButton('重置', function() {
this.fp.form.reset();
}, this);
}
});

Ext.onReady(function() {
var win = new LoginWindow();
var rc = Ext.getDom("randCode");
var rcp = Ext.get(rc.parentNode);
rcp.createChild({tag: 'img', src: 'image.jsp',align:'absbottom'});
win.show();
setTimeout(function() {
Ext.get('loading-mask').fadeOut({
remove : true
});
}, 300);
});



这是extjs3 的写法,能否将其改成符合extjs4规范的代码
...全文
92 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
燕飞残月天 2016-10-13
  • 打赏
  • 举报
回复
啊啊啊啊啊啊啊啊啊

87,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧