PDA

View Full Version : toolTip for textArea control



shico
6 Aug 2010, 5:41 AM
Hello guys,

I spent couple of hours trying in vain make tool tips work for TextArea control created dynamically.
I added QuickTip initialization and then specified tooltip config property for the control, but it doesn't work.
BTW tooltip property is not documented at all. I found it browsing the source code.
Here is the code:




Ext.QuickTips.init();

...

var txtDescription = new Ext.form.TextArea({
xtype: 'textarea',
height: 120,
fieldLabel: 'Description',
anchor: '99%',
listeners: iDescription,
tooltip: 'Please describe the product briefly.',
value: this.configObj.product.Description
});

....
On runtime code from above transforms to following html (only part is shown):


<textarea name="ext-comp-1147" id="ext-comp-1147" autocomplete="off" style="width: 1396px; height: 120px;" class="x-form-textarea x-form-field"/>
What I basically need to do is just to add new attribute to html from above:


<textarea ... ext:qtip="Please describe the product briefly." />

If i do it manually (via FireBug) it works perfectly (see attachment).

Any thoughts?

P.S. It seems that this is a problem not for TextArea only but for any container controls, but works fine for Ext.Action :(

Condor
6 Aug 2010, 5:45 AM
You could use:

listeners: {
render: function(c){
Ext.QuickTips.register({
target: c.getEl(),
text: 'Please describe the product briefly.'
});
}
}

(there are also plugins/overrides that can do this for you)

shico
6 Aug 2010, 6:32 AM
Thank you, Mr. Condor!

It helped :)

BTW, I've realized what was my mistake. tooltip config property is valid for buttons, datepickers etc. but it is not used in conteiner controls.

SrinivasKothuri
5 Apr 2012, 2:55 AM
I think Ext.QuickTips.init need to be called before register().