i have to customize some Modules in GO. Previously i done it directly in the code. This is obviously the worst way if you want to update your GO.
Actually i write my own module for it and use
Code: Select all
Ext.override()
Original
Code: Select all
this.usernameField = new Ext.form.TextField({
fieldLabel: GO.lang['strUsername'],
name: 'username'
});
Modification
Code: Select all
this.usernameField = new Ext.form.TextField({
fieldLabel: GO.lang['strUsername'],
name: 'username',
panel: this,
listeners: {
blur: function(){
if (this.panel.usernameField.getValue()) {
if (this.panel.usernameField.getValue().lastIndexOf(".")<0) {
alert("Der Benutzername muss einen Punkt enthalten (vorname.nachname).");
}
else {
var name=this.panel.usernameField.getValue().split('.');
this.panel.firstNameField.setValue(name[0].substr(0, 1).toUpperCase() + name[0].substr(1));
this.panel.lastNameField.setValue(name[1].substr(0, 1).toUpperCase() + name[1].substr(1));
var mail=name[0].substr(0,1)+'.'+name[1]+'@mydomain.net';
this.panel.emailField.setValue(mail);
}
}
},
}
});
How can i modify this without hacking the code directly?
Regards
Thomas