开发者

Flex Hero spark component - changing view from within custom itemrenderer

I've made 开发者_Go百科a custom list itemRenderer with 2 buttons and a label. One button deletes the list entry (and thats not the problem) the second button would change the actual view. Does anyone knows how I can change actual view within the itemrenderer ?


From what I think I understand, you want to change a viewstack or something. What you want to do is bubble an event from the itemRenderer up to a point in the display list where someone will listen and trigger an event handler which then changes the view.

So, in your itemRenderer do

dispatchEvent(new Event('someEventName', true));

And up the display list you need to listen for that even

this.addEventListener('someEventName', someHandlerFunction);

And in that function just switch your view or whatever else you want.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜