A Persistent/Interactive Tooltip in Flex

I came across a requirement at work a few weeks back which involved an "interactive" tooltip... We needed to provide a summary of information in the tooltip, but then provide a link button to a more detailed document.

I came up with the following example by creating some functionality around the DataGrid mouse movements to display a "tooltip" (in reality a Menu instance) at the mouse position. Rather than digging into the framework to try and extend the ToolTip class to make it "stick" when moused over, I realized we've got popup menu functionality like that already. Slap a custom menu item renderer in there, skin it, and you've got a mousable, interactive tooltip instance.

I could have gone the extra mile and created a custom DataGrid instance using this new functionality, but I'm lazy so I'm just going to post the instance I implemented and let you figure out how to implement it for yourself :-) The idea being that it could be just as easily implemented on any List based control, and even with a bit of work any component in the Flex framework. Just modify the renderer to fit the content you need!

Example Here

Source Here

Copy from DataGrid to Clipboard/Excel in Flex

A really simple example today for a pretty useful feature... being able to copy contents from a datagrid (or any structure which uses a dataProvider for that matter) onto the system clipboard, and into an application like Excel.

Excel is able to recognize an HTML table format and pastes the structure into appropriate cells. The following example is tailored to that type of structure, but can really be formatted to whatever needs you have by modifying the createHTML() (or more appropriately named) method.

View example here : Example

And source here : Source Code

Set "Loading" screen background color on Flex

If I had a nickel for every time I've looked at a Flex application these days and seen that dull, default greyish blue color...

So here's my tip for the day:

Check out the compiler arguments line in the Flex properties and add

-default-background-color #PUTYOURCOLORHERE

Easy to do, and then your Flex apps won't look like everyone else's anymore :-)

More compiler arguments are available if you'd like to get frisky...

http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=compilers_123_24.html

And better yet, check out Ted Patrick's blog on creating custom preloaders and be a real rock star.

http://www.onflex.org/ted/2006/07/flex-2-preloaders-swf-png-gif-examples.php

Disable single button in ToggleButtonBar

So after a short period of searching, there doesn't seem to be a straight-forward way to disable a single ToggleButtonBar button instance... here's what I found worked:

UIComponent(tBBInstance.rawChildren.getChildAt(X)).enabled/disabled

Anyone find a clearer way?

BlogCFC was created by Raymond Camden. This blog is running version 5.005.