I've updated my previous blog post on Tree Lines to include a Flex 4/Spark version which uses the MXTreeItemRenderer class.
For more documentation on how to use it see the blog post linked above.
I've also updated the AdvancedDataGrid example to show tree lines in the tree:
Showing posts with label AdvancedDataGrid. Show all posts
Showing posts with label AdvancedDataGrid. Show all posts
Thursday, September 9, 2010
Friday, April 24, 2009
Tree Lines
In Flex I've seen how you can configure Trees by changing the disclosure (expand/collapse) icon, the folder/leaf icons, background colors, indentation, etc. But I've never seen the option for rendering tree lines like you can in Java, C# and most other languages.
I've created a custom TreeItemRenderer that does renderer tree lines. It has these properties:
If you know of any other solutions out there I'd be interested to see them.
** September 28th 2009 Updated **
I've added another example application showing how to render tree lines in an AdvancedDataGrid control.Flex Example Application AdvancedDataGrid API AdvancedDataGridGroupItemRenderer API
Flex 4/Spark Version
Here is a very similar version written in Flex 4. It uses a lot of the same code, but uses a Spark item renderer instead. There is probably a much nicer way to do this using the new Spark Path or Line controls, but since the code was already written I went with this solution.
An example of tree lines in an AdvancedDataGrid with a Flex 4 itemRenderer is on my newer blog post.
I've created a custom TreeItemRenderer that does renderer tree lines. It has these properties:
<ui:TreeItemLinesRenderer Styles lineAlpha="1" lineColor="#808080" lineThickness="1" lineStyle="dotted"/>And here is an example of it in action (right click to view source):
If you know of any other solutions out there I'd be interested to see them.
** September 28th 2009 Updated **
I've added another example application showing how to render tree lines in an AdvancedDataGrid control.
Flex 4/Spark Version
Here is a very similar version written in Flex 4. It uses a lot of the same code, but uses a Spark item renderer instead. There is probably a much nicer way to do this using the new Spark Path or Line controls, but since the code was already written I went with this solution.
An example of tree lines in an AdvancedDataGrid with a Flex 4 itemRenderer is on my newer blog post.
Labels:
AdvancedDataGrid,
Lines,
Tree
Thursday, April 16, 2009
Tree Icon Spinner (not using animated gif)
I've been disappointed that Flex doesn't natively support animated gifs. I especially wanted to use them inside Flex
There are also the start(), stop() and running functions to control the spinner manually.
The spinners have a few styles that you can set to customize the appearance:
I've created an example of the four types of spinners in four Trees. Each tree node loads its children after a 2 second delay during which time the spinner is shown, so try expanding each tree (right click to view source):
Let me know if you like them!
Also, make sure you do call stop() on the spinner when you don't need it anymore... otherwise you might notice your Flex app starts to run very slowly like mine did...
** September 28th 2009 Updated **
I've added another example application showing how to show the spinner inside an AdvancedDataGrid control.
Flex Example Application AdvancedDataGrid API AdvancedDataGridGroupItemRenderer API
Trees when I'm loading the children dynamically. So instead of trying to get animated gifs to work (see this example if you are interested) I created a relatively simple Spinner class that draws a circular spinner using just Flex Graphics. The spinner is animated using a Timer. If you set the startImmediately property to true then the animation starts when the spinner component is added to a parent component. And it is always stopped when it gets removed from its parent. There are also the start(), stop() and running functions to control the spinner manually.
The spinners have a few styles that you can set to customize the appearance:
<ui:Spinner Properties delay="100" startImmediately="false" Styles backgroundAlpha="1" backgroundColor="NaN" spinnerColor="#829AD1" spinnerHighlightColor="#001A8E" spinnerThickness="3" spinnerLineThickness="2" spinnerType="gradientcircle"/>
I've created an example of the four types of spinners in four Trees. Each tree node loads its children after a 2 second delay during which time the spinner is shown, so try expanding each tree (right click to view source):
Let me know if you like them!
Also, make sure you do call stop() on the spinner when you don't need it anymore... otherwise you might notice your Flex app starts to run very slowly like mine did...
** September 28th 2009 Updated **
I've added another example application showing how to show the spinner inside an AdvancedDataGrid control.
Labels:
AdvancedDataGrid,
Icon,
Spinner,
Tree
Subscribe to:
Posts (Atom)
