开发者

Flex 4 Alternative to partAdded() in an ItemRenderer

开发者 https://www.devze.com 2023-01-26 11:07 出处:网络
I\'m working on an application which uses a List and some itemRenderers. I have a button displayed in the \"selected\" state automatically set by the List component. This button is supposed to dispatc

I'm working on an application which uses a List and some itemRenderers. I have a button displayed in the "selected" state automatically set by the List component. This button is supposed to dispatch a custom event when clicked. Problem is, I don't know how to add my event listener, and I don't want to 开发者_如何学Pythonuse 'click=""' because it's kinda dirty IMHO. / If it was a SkinnableContainer, I could override the partAdded() but I couldn't find anything similar in the ItemRenderer or the DataRenderer.

Any hints?

Thanks !


You may use the button creationComplete event to add the listener.

Or, for complex itemRenderers I usually create my own that extends SkinnableComponent and implements IDataRenderer. You can then override partAdded/partRemoved functions. Note that you will also need to define and support the skin states (hovered, selected...).

0

精彩评论

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