|
Sree, You can create an ItemRenderer
based on any UIComponent and add your states into that. Then assign that
ItemRenderer to your List. I have started working on an example. This is not
complete because it doesn’t handle selecting an item. But it should be a
good starting point. DynamicListItemRenderer.mxml: <?xml version="1.0"
encoding="utf-8"?> <mx:VBox
xmlns:mx="http://www.adobe.com/2006/mxml"
borderStyle="solid" backgroundColor="0xFFFFFF" verticalGap="-2"
cornerRadius="4" borderColor="0x000000" rollOver="currentState='expanded'"
rollOut="currentState=''"> <mx:transitions> <mx:Transition
fromState="*" toState="*"> <mx:Resize
target="{this}" duration="300"/> </mx:Transition> </mx:transitions> <mx:states> <mx:State
name="expanded"> <mx:AddChild
creationPolicy="all"> <mx:Label
text="{data.desc}"/> </mx:AddChild> </mx:State> </mx:states> <mx:Label
text="{data.label}"/> </mx:VBox> Main.mxml: <?xml version="1.0"
encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
width="600" height="500"
preinitialize="initList()"> <mx:Script> <![CDATA[ import
mx.collections.ArrayCollection; [Bindable] public
var dataList:ArrayCollection; public
function initList():void { dataList
= new ArrayCollection([{label:"One", desc:"The {label:"Two",
desc:"The pressure was too much to overcome"}, {label:"Four",
desc:"Look for exciting matchups"}]); } ]]> </mx:Script> <mx:List
id="mainList" itemRenderer="DynamicListItemRenderer"
variableRowHeight="true" width="100%"
height="300" dataProvider="{dataList}"/> </mx:Application> From: Is it possible to create states within a List that changes
height on select? Basically, I need to switch between a simple and advanced
view in a list only on select. I tried using a Repeater in a VBox, but navigating up and
down using arrow keys is not possible(?) when using a repeater. Any guidance is appreciated. Thanks Sree -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
|
- RE: [flexcoders] States within List Jason Szeto
- Re: [flexcoders] States within List Sreejith Unnikrishnan

