开发者

Flex list switching itemRender of selected item

In Flex 4 (beta 2), I have a list control populated from an XMLListCollection.

What I would like to do is when an item is selected in the list, use a custom item renderer on the selected item as well as the item that appears just prior to the selected item in the list.

I am using a spark list control, but I am open to alternate components if the solution makes sense.

Here is the strucutre of the xml used to populate the XMLListCollection

<Images>
   <Image>
      <Id>1</Id>
      <Url>http://www.mydomain.com/image1.png</Url>
   </Image>
   <Image>
      <Id>2</Id>
      <Url>http://www.mydomain.com/image2.png</Url>
  开发者_JAVA百科 </Image>
<Images>

Thank you in advance.


Why not use one itemRenderer which has a number of states which vary based on what the current data is? That would accomplish your goal in a much faster, simpler, and maintainable fashion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜