I want to change 'Labelxx' to 'New Label' in a DisplayField. How can I do this? Below is my code:
MyFormUi = Ext.extend(Ext.form.FormPanel, {
title: 'Rates ',
id: 'id_form',
initComponent: function() {
this.items = [{
xtype: 'displayfield',
fieldLabel: 'Labelxx',
anchor: '100%',
name: 'name_lb',
ref: 'localCurrencylbl',
id: 'id_lb'
}];
MyFormUi.superclass.initComponent.call(this);
}
});
To change DisplayField text
:
Ext.getCmp('id_lb').setValue('New text');
To change the fieldLabel
:
Ext.getCmp('id_lb').setFieldLabel('New Label');
Note: It is not recommended to work with id's tho.