且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

FLEX3:自定义项目渲染不听父母所分派的事件

更新时间:2023-12-02 18:08:04

您定制的itemRenderer不应该与他们的父母注册事件侦听器,但你的全选复选框,即

Your custom ItemRenderers should not register an event listener with their parent, but with your "select all" checkbox, i.e.

theCheckbox.addEventListener(YourEvent.YOUR_EVENT, itemRendererSelectAllHandler);

如果做不到这一点,你可以发表您的code它增加了事件侦听器,其中调度该事件形成的复选框?

Failing that, can you post your code which adds the event listener and which dispatches the event form the checkbox?

编辑:

这是你的错误:在渲染器的init(),你需要不添加事件侦听器的渲染,而是将指派该事件的容器。因此,使之成为

Here's your bug: In renderer's init(), you need to add an event listener not to the renderer, but to the container which dispatches the event. So make that a

container.addEventListener(Container.SELECT_ALL_USERS, selectAllHandler, false, 0, true);