Flex : Adding a click handler on SkinnableDataContainer's items

Posted by sebpiq on Stack Overflow See other posts from Stack Overflow or by sebpiq
Published on 2010-05-21T12:57:17Z Indexed on 2010/05/21 15:10 UTC
Read the original article Hit count: 218

Filed under:
|
|

Hi,

I am new to Flex.

What I am looking for here is adding a click handler on all the items created by a SkinnableDataContainer. I tried several things that didn't work, and I have no idea what is the right way to do it.

<s:SkinnableDataContainer id="teamList"
                          itemRenderer="TeamSummaryRenderer">
    <s:dataProvider>
        <s:ArrayList>
            <fx:Object teamName="A super team 1"/>
            <fx:Object teamName="A super team 2"/>
            <fx:Object teamName="A super team 3"/>
        </s:ArrayList>
    </s:dataProvider>
</s:SkinnableDataContainer>

Furthermore, I don't want to declare the handler in my custom TeamSummaryRenderer component. I would prefer that the handler code stays at application level.

Is there a simple 'Flex-ish' to achieve this ?

© Stack Overflow or respective owner

Related posts about flex4

Related posts about itemrenderer