Hi,
I have a basic list that uses an item renderer to display images.
If I add an item to the list, on a button click for example, the item gets added to the list perfectly fine but when i rollover/select this newly added item the highlight is not visibe and it actually stays on the list item that was previously selected?
Could anyone shed some light on this really, really anoying issue for me please?
Thanks
Flexchief
Thanks for the reply but do you know of any sort of workaround for this problem with UIDs?
Assuming your dataProvider is filled with a list of strings:
[Bindable]
public var dataProvider:IList;
private static function getListData(items:IList):ILIst
{
var source:Array = [];
for each(var label:String in items)
{
source.push( {label:label} );
}
return new ArrayCollection(source);
}
<mx:List dataProvider="{getListData(this.dataProvider)}" />Thanks for the helpful suggestions guys...
Unfortunately using Spark List is not an option as i'm still using Flex 3.3 and migrating my project to flex 4 or above is not an option as it is way too large.
The List data contains objects as well as strings so using the getListData method above was also not suitable for me.
In the end i came up with a workaround that meant i did not display a selecion color.
Thanks for all your help.
Flexchief
That is an easy fix..
private static function getListData(items:IList):ILIst
{
var source:Array = [];
for each(var item:Object in items)
{
if(item is String)
source.push( {label:item} );
else
source.push(item);
}
return new ArrayCollection(source);
}
But I suppose disabling the selection color all together works too.
North America
Europe, Middle East and Africa
Asia Pacific