extjs创建弹窗输入框

function changPwd(){
  GLOBAL.pwdBox = new Ext.custom.basicWindow({
      title:"修改密码",
      width:500,
      height:340,
      bodyPadding:"20",
      items:[
        {
          xtype:"panel",
          items:[
            new Ext.custom.middletextfield({
              itemId:"Pwd",
              fieldLabel:"当前密码",
              beforeLabelTextTpl:required,
              inputType:"password",
              margin:"10"
            }),
            new Ext.custom.middletextfield({
              itemId:"newPwd",
              fieldLabel:"新的密码",
              inputType:"password",

              beforeLabelTextTpl:required,
              margin:"10"
            }),
            new Ext.custom.middletextfield({
              itemId:"trueId",
              fieldLabel:"确认密码",
              inputType:"password",

              beforeLabelTextTpl:required,
              margin:"10"
            })
          ]
        },
        {
          xtype:"panel",
          layout:"hbox",
          items:[{
            xtype:"button",
            width:100,
            height:34,
            margin:"20 10 0 100",
            text:"确定",
            style:"background:green;border:none;",
            handler:function(){
              var oldPwd = GLOBAL.pwdBox.down("#Pwd").getValue(),
                newPwd = GLOBAL.pwdBox.down("#newPwd").getValue(),
                truePwd =GLOBAL.pwdBox.down("#trueId").getValue()
              if(oldPwd==""||newPwd==""||truePwd==""){
                Ext.Msg.alert("提示","密码不能为空")
              }
              else if(oldPwd==newPwd){
                Ext.Msg.alert("提示","两次密码不可重复")
              }else if(newPwd!=truePwd){
                Ext.Msg.alert("提示","新密码不一致")

              }else{
                $.ajax({
                  url:"/Handler/AdminHandler.ashx?action=updatepass",
                  type:"post",
                  dataType:"json",
                  async:false,
                  data:{
                    userPwd:oldPwd,
                    newPwd:newPwd
                  }
                }).done(function(result){
                  if(result.success){
                    Ext.Msg.alert("提示",result.success)
                    GLOBAL.pwdBox.hide()
                  }
                  if(result.err){
                    Ext.Msg.alert("提示",result.err)
                  }
                })
              }
            },
          },{
            xtype:"button",
            width:100,
            height:34,
            margin:"20 10 0 20",
            text:"取消",
            handler:function(){
              GLOBAL.pwdBox.hide();
            },
            style:"background:blue;border:none;"
          }]
        }
      ]
    }

  ).show();
}
记得调用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值