PDA

View Full Version : Best approach for anchored placement of a dynamic size tooltip?



cmeans
14 Mar 2013, 7:54 AM
ExtJS 4.1.3


I need to place the popup adjacent to an element within a larger div.
The popup needs to be constrained to the div client-area (so it can go above, below, left or right of the target element - determined by available space and a preference order).
The popup also has a callout (beak) that must be aligned to the anchor point for the target (but can be anywhere along the adjacent edge of the popup).

Given that the popup size is dynamic (results of a ComponentLoader AJAX call), I've been looking at the afterlayout event, but it is fired 8 times for each rendering of the popup...it's unclear if there are any properties that are passed in that can tell me which is the last call (so I'm not constantly recalculating things).

Any suggestions or pointers would be appreciated.

I know the tooltip class has an anchor/callout element, but I need to use a custom image, plus there doesn't seem to be much control over the placement of that element on the tooltip itself.

Thanks.