Archive

Posts Tagged ‘List’

Using a spark List to simulate a stacked bar chart

March 28th, 2010 No comments

This is an example of a spark List with a custom item renderer that looks like a stacked bar chart.
Read more…

Introducing Flex 4

March 22nd, 2010 3 comments

Flex 4 has been released. This is a major release of Flex that introduces some new features that allow you an amazing amount of flexibility and power in building killer internet applications.
Read more…

Learn how to create a simple virtual layout in Flex 4

March 6th, 2010 11 comments

This post goes over the basics of writing a very simple custom layout that supports virtualization in spark. It assumes that you have already built a custom layout that handles the real (non-virtual) case and are comfortable doing so.
Read more…

List with truncation instead of a horizontal scroll bar

February 15th, 2010 4 comments

The default spark List will add a horizontal scroll bar when the contents of the List are wider than its width. This post shows how to change that behavior using a custom item renderer so that a truncation mark like an ellipsis is used instead.
Read more…

Displaying the row number or index in a spark List

February 8th, 2010 2 comments

The ItemRenderer class in Flex 4 has an itemIndex property that was added after beta2. You can use this property within your item renderer to display the row number or index of an item in a spark List.
Read more…

Using DataRenderer to add custom states to a spark List renderer

February 7th, 2010 No comments

ItemRenderer has logic built in that changes between some standard states like normal, hovered, selected, etc. You can supplement this logic by overriding ItemRenderer.getCurrentRendererState(), or do away with the built in states altogether by subclassing DataRenderer instead of ItemRenderer.
Read more…

Disable selection on some items in a spark List

December 20th, 2009 3 comments

The spark List component in Flex 4 treats every item equally with regards to selection. Sometimes I find it useful to customize this behavior so certain items cannot be selected. You can simulate this behavior by customizing the item renderer to make the selected state visually identical to the normal state, but to get more accurate functionality you will need to subclass List.
Read more…

Multiple selection in a spark List without the control key

December 13th, 2009 2 comments

The spark List component in Flex 4 allows you to select multiple items when you set allowMultipleSelection to true. With this flag set you can select multiple items by using the control/command key.

If you want to have a List that allows multiple selection, but does not require the user to hold down the control key when selecting items you can subclass List and override the item_mouseDownHandler() method.
Read more…

Binding warnings when using Object in a List dataProvider

November 11th, 2009 6 comments

If you have built a custom item renderer for a DataGroup or List you may have come across warnings in your Flash Builder console output similar to this:

warning: unable to bind to property 'firstName' on class 'Object' (class is not an IEventDispatcher)

Read more…

Changing the position of the scroll bars in a spark List

October 9th, 2009 No comments

The default spark List skin wraps the the underlying DataGroup with a Scroller component to easily provide scrolling functionality. Custom skinning the Scroller component isn’t very flexible; you can custom skin each scrollbar to change the visuals on them, but you can’t easily reposition them. In these cases it usually makes more sense to get rid of the Scroller and hook up the scrollbars directly.
Read more…