How to know when my itemRenderer is selected
This problem was logged as bug SDK-9846. It didn’t seem that easy for an itemRenderer to know that it was selected so that it can display itself accordingly. However, it is easy for an itemRenderer to know that it’s selected. As mentioned by Alex Harui, in the bug report, here is the simple line that let’s you know:
ListBase(owner).isItemSelected(data)
If you want to change the appearance of your itemRenderer depending on whether it is selected, you should do so using the line above within the updateDisplayList function that you have overridden.
In the following example, the text in the “price” column changes some of its attributes when selected.
Demo: selectExample.swf
Sample Code: selectExample.mxml, MyLabel.as
9:35 AM
|
Labels:
Flex Resources,
Flex Samples
|
This entry was posted on 9:35 AM
and is filed under
Flex Resources
,
Flex Samples
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
0 comments:
Post a Comment