I want to add like a ? beside of a TextField so as if the mouse pases over, it shows some help How can I do it please. Thnx
Many ways to do this, and many different levels of complexity, but at it's simplest I might do something like this...
Add an interceptor function to the Fields init method that adds the question mark and uses qtip's to display a message - this allows all types of fields that inherit from the Field class to have this functionality.
For example:
Ext.intercept(Ext.form.Field.prototype, 'initComponent', function() {
var fl = this.fieldLabel, h = this.helpText;
if (h && h !== '' && fl) {
this.fieldLabel = fl+'<span style="color:green;" ext:qtip="'+h+'">?</span> ';
}
});
Then in each field definition you would have a helpText property:
{
fieldLabel: 'First Name',
helpText: 'This is your first name dummy!',
name: 'first',
allowBlank:false
}
This produces:
Im sure you can expand on it from what I have provided, and if you need more info on interceptors, check out my blog post on them.
Enjoy!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With