コンボボックスの選択に基づいてテキストフィールドのラベル属性を表示しようとしています。そのために、コンボボックスの変更リスナーを作成し、リスナーでコンボボックスの値をチェックしており、これに基づいてテキストフィールドの fieldLabel プロパティを変更する必要があります。以下はコードです。
textfield:
xtype:'textfield',
id:'firstName',
fieldLabel: 'Billing',
name: 'firstName',
maxLength: 30,
enforceMaxLength :true
コンボボックスリスナーメソッド、
listeners:{
change:function(field, newValue, oldValue)
{
if(newValue == "billing")
{
var firstName = Ext.getCmp('firstName');
firstName.fieldLabel = 'Billing'
}
else if(newValue == "shipping"){
var firstName = Ext.getCmp('firstName');
firstName.fieldLabel = 'Shipping'
}
else if(newValue == "recipient"){
var firstName = Ext.getCmp('firstName');
firstName.fieldLabel = 'Receipient'
}
}
このコードをデバッグしているときに、フィールド値が fieldLabel 属性に割り当てられているが、UI に反映されていないことがわかります。ここで何かが恋しいですか?
ありがとう。