I have this problem where I need to add a red asterisk beside a fieldLabel
when a field is marked as \"required\" (or allowBlank: false
)
In
You can also override and extend nothing and just create a controller action like so:
Ext.define('MyApp.controller.MyForm', {
extend: 'Ext.app.Controller',
markMandatoryFields: function(field, options) {
if (field && field.isFieldLabelable && field.fieldLabel && field.allowBlank == false) {
field.fieldLabel += ' *';
}
},
init: function() {
this.control({
"field": {
beforerender: this.markMandatoryFields
}
});
}
});