简体   繁体   中英

Flex 3 TileList selected item strange behaviour

I have a Flex TileList with an itemRenderer made by me.

The list loads the content perfectly and renders it. Renderer is a simple canvas element with a checkbox and another canvas with some labels with data. I implemented a method that, on TileList itemClick="clickedItemHandler(event)" , changes the state of the checkbox (if checked -> uncheck, and vice versa).

Problem is: the method works if i click on any place of the item, EXCEPT the checkbox. When i click the checkbox, it doesn't change state.

My thoughts: maybe i was changing the state of the checkbox, and the event changing it back, but i debugged it and it doesn't look like so..

The solution is actually quite simple. Perhaps the best way to make this work is making sure the CheckBox ignores mouse clicks, and this can be done by setting the "mouseEnabled" attribute to false.

Cheers

I think you're probably correct. The checkbox toggles when you click it and then you toggle it back when the event gets to the TileList . You may not see this when debugging depending on how you are confirming... you may be able to fix this by confirming that the target of the event is not a CheckBox .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM