PDA

View Full Version : Need anchored Window - override functionality ofToolTip or re-style window?



jscolton
12 Nov 2009, 12:42 AM
On clicking a normal HTML anchor link, I want to launch a window that is anchored to the link. So I need the styling of an anchored ToolTip (see http://www.extjs.com/deploy/dev/examples/simple-widgets/qtips.html) with the functionality of a window (ie launching it via onclick, not onmouseover) and is modal.

Is it better to override the functionality of the ToolTip or to re-style a Window?

Many thanks
Jeremy

Animal
12 Nov 2009, 1:14 AM
I'd say use a ToolTip. Show it where and when you want, and use autoHide: false, closable: true

jscolton
15 Nov 2009, 3:47 AM
Thanks for the reply.

I am using the ToolTip as you suggested.

I am trying to add buttons via the 'buttons:' array attribute but my buttons are not appearing.

Here's my code:
new Ext.ToolTip({

/* override to trigger tip via click not mouseover */
initTarget : function(target){
var t;
if((t = Ext.get(target))){
if(this.target){
this.target = Ext.get(this.target);
this.target.un('click', this.onTargetOver, this);
}
this.mon(t, {
click: this.onTargetOver,
scope: this
});
this.target = t;
}
if(this.anchor){
this.anchorTarget = this.target;
}
},


//title: '<a href="#">Rich Content Tooltip</a>',
title: 'Selected Categories',
id: 'content-anchor-tip',
anchorOffset: 50, //move anchor graphic X pixels down
anchorToTarget: true,
defaultAlign: 'l-r',
target: 'leftCallout',
layout: 'form',
anchor: 'left',
html: null,
mouseOffset: [1,-46],
shadow: false,
floating: {
shadow: false,
shim: true,
useDisplay: true,
constrain: false
},

width: 415,
height: 500,
autoHide: false,
closable: true,
contentEl: 'content-tip', // load content from the page

buttons: {
yes: true,
no: true,
cancel: true
}



});

Any ideas?