
Hi......
How can I get the ItemRenderer of a flex spark list from its DataProvider objects?
please give me an example for that.....
Thanks

Ans:
public function getItemRenderer(list:List, item:Object):ItemRenderer
{
var dataGroup:DataGroup = list.dataGroup;
var n:int = dataGroup.numElements;
for (var i:int = 0; i < n; i++)
{
var renderer:ItemRenderer = dataGroup.getElementAt(i) as ItemRenderer;
if (renderer && renderer.data == item)
return renderer;
}
}
I think this function will be helpful for you.
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.