extjs的Ext.MessageBox.prompt可以把那文本框变为密文显示吗

我想弹出个框然后让用户输入密码,可是prompt是明文的,可以变成密文的吗

第1个回答  推荐于2017-12-16
那就别用Ext.MessageBox.prompt了,自己写个window弹出个跟Ext.MessageBox.prompt类似的东西,做成你想要的不就好了

给你个
Ext.onReady(function() {
var formPanel = new Ext.form.FormPanel({
autoWidth:true,
layout:"form",
frame:true,
labelWidth:65,
labelAlign:"right",
items:[{
xtype:"label",
height : 20,
text :"请输入密码:"
},{
xtype : "textfield",
inputType : 'password',
height : 20,
hideLabel : true,
id:"cancelarea",
anchor : "95%"
}],
buttons : [{
text : '确定',
handler : function(){
alert(Ext.getCmp('cancelarea').getValue());
}
}, {
text : '取消',
handler : function(){
win.hide();
}
}]
});
var win = new Ext.Window({
title:"密码",
modal:true,
width:250,
height:115,
collapsible:false,
resizable:false,
closeAction:'hide',
items:[formPanel]
});
win.show();
});本回答被提问者采纳
第2个回答  2010-10-27
你试试这个!

var pass = new Ext.form.TextField({
fieldLabel: 'PassWorld',
minLength: 6,
maxLength: 30,
inputType: 'password', //密码
allowBlank: false
});

参考资料:334676937