PDA

View Full Version : [SOLVED] a problem with tooltip's target



pirusira
14 Jun 2010, 8:41 PM
Hello All.

I'm making tooltips.


for(i=0;i<records.length;i++){
Ext.getCmp('gPortlet_'+store.getAt(i).get('groupCode')).add({
html: 'test',
id: 'printer_'+store.getAt(i).get('ipAddr'),
cls: 'portletPrinter'
});
new Ext.ToolTip({
target: Ext.getCmp('gPortlet_'+store.getAt(i).get('groupCode')).items.items[i].id,
title: 'Mouse Track',
width:200,
html: 'This tip will follow the mouse while it is over the element',
trackMouse:true
});
}

In my code above, no tootip is added.
It may be a target problem.
If I code like this :


alert(Ext.getCmp('gPortlet_'+store.getAt(i).get('groupCode')).items.items[i].id);

It shows me the right value.('printer_144.214.16.80')
And if I set the target like this:


target: 'printer_144.214.16.80',

It works well.
But it has to be dynamically.

What's wrong with that?

Thanks in advance.
Stan

Animal
14 Jun 2010, 9:41 PM
You're programmatically creating a tip for every Record?

Use a DataTip, that's what it is for.

pirusira
15 Jun 2010, 1:36 AM
Thanks Animal!
I didn't know DataTip. :D