使用嵌套中继器的 flex 3

发布于 2024-07-14 22:52:26 字数 488 浏览 3 评论 0原文

我正在尝试使用嵌套转发器循环遍历 arraycollection 的一行;

<mx:Repeater id="rp1" dataProvider="{arrayCollection}">
    <mx:Repeater id="rp2" dataProvider="{rp1.currentItem}">
        <mx:Button height="49" width="50" label="{rp2.currentItem.name}" /> 
    </mx:Repeater>
</mx:Repeater> 

我想做的是让中继器循环遍历 currentRow 中的所有属性,例如。 姓名、年龄、地址等。目前我所做的就是调用 rp2.currentItem.name ,它显式调用属性的名称,然后返回值。

是否可以不显式命名属性来循环遍历所有属性并使用嵌套转发器为每个属性显示按钮?谢谢

I'm trying to loop through a row of an arraycollection using nested repeater;

<mx:Repeater id="rp1" dataProvider="{arrayCollection}">
    <mx:Repeater id="rp2" dataProvider="{rp1.currentItem}">
        <mx:Button height="49" width="50" label="{rp2.currentItem.name}" /> 
    </mx:Repeater>
</mx:Repeater> 

What im trying to do is make the repeater loop through all the attributes in the currentRow, eg. name,age, address etc. At the moment all i do is call rp2.currentItem.name which explicitly calls out the name of the attribute and then the value is returned.

Is it possible instead of explicity naming the attribute to just loop through them all and dispplay button for each using the nested repeater?thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

懵少女 2024-07-21 22:52:26

您想要为 ArrayCollection 的所有对象使用一个 Repeater 吗? 使用自定义组件。

Do you want a single Repeater for all objects of your ArrayCollection? Use a custom component.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文