今晚大老虎之程序猿 2014-10-12 14:24 采纳率: 0%
浏览 4101

Ext 根据下拉框选择不同的值 显示不同的文本框

Ext 根据下拉框选择不同的值 显示不同的文本框 只显示了文本框没有显示fieldLabel
Ext.onReady(function(){
this.username = {
id:'usernameId',
tabIndex:4,
xtype:'textfield',
fieldLabel: '密码',
cls:'x-upper-text',
width:80,
name: 'username',
maxLength:25,
upperText: true,
anchor:'98%'
};
this.password = {
id:'passwordId',
tabIndex:4,
xtype:'textfield',
fieldLabel: '密码',
cls:'x-upper-text',
width:80,
name: 'password',
maxLength:25,
upperText: true,
anchor:'98%',
hidden: true,
hideLabel:true
};
this.age = {
id:'ageId',
tabIndex:4,
xtype:'textfield',
fieldLabel: '年纪',
cls:'x-upper-text',
width:80,
name: 'age',
maxLength:25,
upperText: true,
anchor:'98%'//,
//hidden: true,
//hideLabel:true
};

this.type = new Ext.form.ComboBox({
        tabIndex:3,

width:80,
anchor:'100%',
fieldLabel: '用户类型',
cls:'x-upper-text',
hiddenName:'docType',
store: new Ext.data.SimpleStore({
fields: ['type', 'typeName'],
data: [
['0', '(0)普通用户'],
['1', '(1)管理员']

]
}),
valueField:'type',
displayField:'typeName',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
forceSelection : true,
width:100,
listeners:{
select:function(combo, record, index){
//alert(record.get('type')+" index : "+index +" combo : "+combo);
var t=record.get('type');
alert(t);
if(t==0){
Ext.getCmp('passwordId').show();
}else{
Ext.getCmp('passwordId').setVisible(false);
}
}.createDelegate(this)
}
});
this.searchForm = new Ext.FormPanel({
labelAlign: 'right',
frame:true,

width: 300,
items:[{
layout:'form',
items:[this.username,this.type,this.password,this.age]
}]
});
new Ext.Window({
title: "窗口",
width: 400,
height: 400,
bodyStyle: "padding: 5px",
items:[this.searchForm]
}).show(Ext.getBody());
})

  • 写回答

1条回答 默认 最新

  • Go 旅城通票 2015-01-07 09:00
    关注

    你自己配置了隐藏fieldLabel了还怎么显示。。。

             this.password = {
                id: 'passwordId',
                tabIndex: 4,
                xtype: 'textfield',
                fieldLabel: '密码',
                cls: 'x-upper-text',
                width: 80,
                name: 'password',
                maxLength: 25,
                upperText: true,
                anchor: '98%',
                hidden: true,
                hideLabel: true////////////////////////
            };
    
                去掉hideLabel: true配置
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题