- Ext.form.Field.prototype.msgTarget = 'side';
-
- var simple = new Ext.FormPanel({
- labelWidth: 75,
- baseCls: 'x-plain',
- width: 150,
- defaultType: 'textfield',
-
- items: [{
- fieldLabel: '帐户',
- name: 'name',
-
- allowBlank:false,
- blankText:'帐户不能为空'
- },{
- inputType:'password',
- fieldLabel: '密码',
-
- name: 'pws',
- allowBlank:false,
- blankText:'密码不能为空'
- }],
- buttons: [{
- text: '登陆',
- type: 'submit',
-
- handler:function(){
- if(simple.form.isValid()){
- Ext.MessageBox.show({
- title: '请稍等',
- msg: '正在加载...',
- progressText: '',
- width:300,
- progress:true,
- closable:false,
- animEl: 'loding'
- });
-
- var f = function(v){
- return function(){
- var i = v/11;
- Ext.MessageBox.updateProgress(i, '');
- };
- };
- for(var i = 1; i < 13; i++){
- setTimeout(f(i), i*150);
- }
-
-
- simple.form.doAction('submit',{
- url:'check.asp',
- method:'post',
- params:'',
-
- success:function(form,action){
- if (action.result.msg=='ok') {
- document.location='index.html';
- } else {
- Ext.Msg.alert('登陆错误',action.result.msg);
- }
- },
-
- failure:function(){
- Ext.Msg.alert('错误','服务器出现错误请稍后再试!');
- }
- });
- }
- }
- },{
- text: '取消',
- handler:function(){simple.form.reset();}
- }]
- });
-
-
- var win = new Ext.Window({
- id:'win',
- title:'用户登陆',
- layout:'fit',
- width:300,
- height:150,
- plain:true,
- bodyStyle:'padding:5px;',
- maximizable:false,
- closeAction:'close',
- closable:false,
- collapsible:true,
- plain: true,
- buttonAlign:'center',
- items:simple
- });
-
- win.show();
posted on
2011-08-02 10:00
Chance_yin
阅读(
1081)
评论()
编辑
收藏
举报