为什么基于图像的itemRenderer始终可见? [英] Why would an Image-based itemRenderer always be visible?

查看:147
本文介绍了为什么基于图像的itemRenderer始终可见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于以下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>

为什么会形象始终可见?我知道一个事实,即data.ongoing总是被设置为假,我知道一个事实,即图像获取这些信息。这甚至不应该有什么关系呢,据我所知道的,但我一直惊讶于Flex的框架之前。谢谢!

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!

推荐答案

这是最有可能的,因为Flex的循环利用的itemRenderer以节省内存。这里的<一个href="http://stackoverflow.com/questions/4971455/weird-behaviour-checkboxes-as-itemrenderer-within-flex-datagrid-flex-3/4971867#4971867">a类似的问题被问之前。

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.

这篇关于为什么基于图像的itemRenderer始终可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆