FormPanel 使用

往Ext.Window中放一个Ext.form.FormPanel,FormPanel有一个属性为url,可以设置其的值,可参照下面的代码:
//Form表单
var addManagerInfoForm = new Ext.form.FormPanel({
  labelAlign:'right',
  labelWidth:70,
  frame:true,
  url:'manage/manager/addManagerInfo.jsp?command=addManagerInfo',
  items:[ mNameField,mPwdField,mEmailField,mTureNamePwdField,mPhoneField ],
  buttons:[{
   text:'提交',
   handler:function(){
    var f = addManagerInfoForm.getForm();
    if(!f.isValid()) return;
    if(f.isValid()){
     f.submit({
      waitMsg:'处理中,请稍候...',
            success:function(form, action){
             if(action.result.changeManagerInfoOK===false){
              Ext.Msg.alert('信息',action.result.msg);
              return;
             }
             Ext.MessageBox.alert('提示','修改成功!',function(btn){
                               f.reset();
                               addInfoWin.hide();
                               window.history.back(-1);
                            });
            },
            failure:function(){
             Ext.Msg.alert('错误','出现异常,请重新尝试一次!');
            }
     });
    }
   }
  },{
   text:'重置',
      type:'reset',
      handler:function(){
                addManagerInfoForm.getForm().reset();
            }
  },{
            text:'取消',
   handler:function(){
    addManagerInfoForm.getForm().reset();
    addInfoWin.hide();
    window.history.back(-1);
   }
  }]
});

//添加窗口
var addInfoWin = new Ext.Window({
  title:'修改个人信息',
  plain: true,
  autoHeight:true,
  width:300,
  closeAction:'hide',
  items:[addManagerInfoForm]
});

你可能感兴趣的:(jsp,ext,F#)