flex 3和itemRenderer [英] flex 3 and itemRenderers

查看:369
本文介绍了flex 3和itemRenderer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据网格和其中一列使用项目渲染器来显示内容。我想知道是否有可能在itemRenderer脚本块内访问datagrid的数据提供者内容。



目前我可以使用项目渲染器中的组件中的数据提供者data.variableName。

我希望能够对脚本块中的这个变量做一些错误处理,有什么想法吗?

解决方案

您可以指定您自己的ItemRenderer组件。在这个组件的MXML中,你可以使用脚本块。然而,像这样:

只需指定该组件为ItemRenderer就可以了:

 < mx:DataGrid dataProvider ={ac}> 
mx:列>
< mx:DataGridColumn>
< mx:itemRenderer>
< mx:Component>
< local:YourRenderer />
< / mx:Component>
< / mx:itemRenderer>
< / mx:DataGridColumn>
< / mx:columns>
< / mx:DataGrid>


i have a datagrid and for one of the columns im using an item renderer to display content. Im wondering is it possible to access the dataprovider content of the datagrid inside a script block in the itemRenderer.

Currently I can access the dataprovider in a component in the item renderer using data.variableName.

I want to be able do some error handling on this variable in the script block, any ideas?

解决方案

You can specify your own ItemRenderer component. Within the MXML of that component you can use the Script block however like.

Just specify the that component as the ItemRenderer like so:

<mx:DataGrid dataProvider="{ac}">
mx:columns>
    <mx:DataGridColumn>
        <mx:itemRenderer>
            <mx:Component>
                <local:YourRenderer />  
            </mx:Component>
        </mx:itemRenderer>
    </mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>

这篇关于flex 3和itemRenderer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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