0
我有一個自定義項目渲染器,即時通訊使用在列表中。項目渲染器中有一個CheckBox和一個ColorPicker。我爲這兩個項目創建了自己的自定義事件類,並且它們不冒泡他們的事件。Flex4 List ItemRenderer子項和事件
您還可以單擊列表中的項目,我有3個監聽器附加到列表中,我不希望列表項處理程序在列表中的子項被點擊時觸發,我該怎麼做?下面
提取物:
protected function updateList():void
{
var proxy:ApplicationDataProxy = ApplicationDataProxy(facade.retrieveProxy(ApplicationDataProxy.NAME));
list.addEventListener(CustomColorEvent.UPDATED_COLOR, colorClickHandler);
list.addEventListener(CustomMenuEvent.CHECK_CLICKED, checkClickHandler);
list.addEventListener(MouseEvent.CLICK, clickHandler);
list.itemRenderer = new ClassFactory(FlightItemRenderer);
list.dataProvider = proxy.flightsList;
}
protected function colorClickHandler(event:CustomColorEvent):void
{
sendNotification(ApplicationFacade.UPDATE_COLOR, {id:event.data, color:event.color});
}
protected function checkClickHandler(event:CustomMenuEvent):void
{
sendNotification(ApplicationFacade.SHOW_FLIGHT, {id:event.data, visible:event.visible});
}
protected function clickHandler(event:Event):void
{
// also gets fired from colours and checkbox, BUT I DON'T WANT IT TO!!!
}
感謝您的回覆,我正在尋找的東西,從來沒有使用過,但知道它。 – Neil 2010-11-26 11:43:58