PDA

View Full Version : Click a link to toggle between show/hide QuickTips?



colinexl
31 Jan 2008, 3:22 PM
Hi Everyone,

I'm trying to create a functionality where the a user can click a link that says "Show All Tooltips", which would display all tooltips currently registered. The link would turn to "Hide All Tooltips", which hides all the tooltips once again.

I've been experimenting around and searching the forms with no luck. Here is what I have so far:



Ext.onReady(function()
{
Ext.QuickTips.init();

// Apply a set of config properties to the singleton
Ext.apply(Ext.QuickTips.getQuickTip(),
{
closable: true,
maxWidth: 200,
minWidth: 100,
showDelay: 1000,
hideDelay: 500,
dismissDelay: 0,
frame: true
});

Ext.QuickTips.register(
{
target: 'help1',
title: "Foo",
text: "Bar"
});

Ext.QuickTips.getQuickTip().qtips.show();
});


I have a DIV with id "help1" in the HTML. When I try to view this page I get an error:

this.targetXY has no properties
...ext-2.0.1/ext-all-debug.js
Line 21588

Here's the line from ext-all-debug.js:


getTargetXY : function(){
21588 return [this.targetXY[0]+this.mouseOffset[0], this.targetXY[1]+this.mouseOffset[1]];
21589 }

Is there an easy way of toggling between show/hide all tooltips?

Thanks,
Colin