Over a million developers have joined DZone.

Aligning the Label in a Tree Control

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

If you've ever rendered images in a tree control, you may have noticed both the image and the label are effectively top, left justified. There's no CSS solution to changing this, the answer is to extend Flex's TreeItemRenderer and move the renderer's label in ActionScript.

Here's my version. Inside updateDisplayList() are a few lines of ActionScript that reposition label to make right justified and vertically centered. The SWF is source code enabled and that source is available here.

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


Published at DZone with permission of Simon Gladman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}