Why would an Image-based itemRenderer always be visible?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 05:59:14

问题


Given the following code:

<mx:DataGridColumn dataField="ongoing" id="ongoing" headerText="" width="20">
    <mx:itemRenderer>
    <mx:Component>
            <mx:Image source="logo.jpg" visible="false" />
        </mx:Component>
    </mx:itemRenderer>
</mx:DataGridColumn>

why would the image always be visible? I know for a fact that data.ongoing is always being set equal to 'False', and I know for a fact that the image is getting this information. That shouldn't even have anything to do with it, as far as I can tell, but I've been surprised by Flex's framework before. Thanks!


回答1:


It's most likely because Flex recycles its itemrenderers to save memory. Here's a similar question that was asked before.

What I would do is override the set data method to set the image's visible value to what it should be.



来源:https://stackoverflow.com/questions/11959854/why-would-an-image-based-itemrenderer-always-be-visible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!