I successfully added ItemRenderer in my List but whenever I scroll down to the bottom and scroll up again. The ItemRenderer in the List would be either gone or shifted places.
I have search up on possible solution but they doesn't seen like working. I tried to put dataChange=”validateNow()” in the ItemRenderer but it doesn't work. I read something about useVirtualLayout="false" but it seen like my List doesn't have useVirtualLayout ?
<mx:List
id="rowsList2" width="{VBoxCall.width}" height="{ scheduleViewerHeight }"
rowHeight="{ scheduleViewer.rowHeight }"
verticalScrollPolicy="off" verticalAlign="middle"
horizontalScrollPolicy="off"
alternatingItemColors="[0xEEEEEE, 0xDFDFDF]" itemRenderer="RendererState">
<!-- Example to showcase Item renderer -->
<mx:dataProvider>
<mx:Object label="Mr Swabby"
data="Juneau"
webPage="http://www.state.ak.us/"/>
<mx:Object label="Mrs Harrington"
data="Montgomery"
webPage="http://www.alabama.gov/" />
</mx:dataProvider>
</mx:List>
Before (picture) http://i.stack.imgur.com/VxoeP.gif
After (picture) http://i.stack.imgur.com/3qHO9.gif
Any Ideas ?
Regards, Mike
Hi Alex,
I've read your blog but I still could find the solution.
I tried to override the set data but it is not working. Whenever I scroll to the bottom and move up again, all the buttons are gone.
Please advise me on this.
Regards,
Mike
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
// Import Event and URLRequest classes.
import flash.events.Event;
import flash.net.URLRequest;
override public function set data(value:Object):void{
if(value != null)
{
super.data = value;
if(data.label == null)
{
Button.label="";
}
else
{
if(data.label == null || data.label=="")
{
Button.label = "";
}
else
{
Button.label = data.label;
}
}
}
else
{
myVBox.removeChild(Button);
}
}
]]>
</mx:Script>
<mx:VBox id="myVBox">
<mx:Button id="Button" width="90">
</mx:Button>
</mx:VBox>
</mx:VBox>
North America
Europe, Middle East and Africa
Asia Pacific