repeater slow

本文详细介绍了Flex中Repeater组件的recycleChildren属性。当设置为true时,此属性能够通过重用现有的子项来提高加载性能,特别是在数据集发生变化时。然而,需要注意的是,这种设置可能会保留过时的状态信息,因此,在使用此属性前,必须仔细考虑应用程序的需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

set <mx:Repeater [b]recycleChildren="true"[/b][color=darkred][/color] id="rp" dataProvider="{dp}">

From Adobe:

The recycleChildren property is a Boolean value that, when set to true, binds new data items into existing Repeater children, incrementally creates children if there are more data items, and destroys extra children that are no longer required.

The default value of the recycleChildren property is false to ensure that you do not leave stale state information in a repeated instance. For example, suppose you use a Repeater object to display photo images and each Image control has an associated NumericStepper control for how many prints you want to order. Some of the state information, such as the image, comes from the dataProvider property. Other state information, such as the print count, is set by user interaction. If you set the recycleChildren property to true and page through the photos by incrementing the Repeater object’s startingIndex value, the Image controls bind to the new images, but the NumericStepper control maintains the old information. Use recycleChildren=”false” only if it is too cumbersome to reset the state information manually, or if you are confident that modifying your dataProvider property should not trigger a recreation of the Repeater object’s children.

Keep in mind that the recycleChildren property has no effect on a Repeater object’s speed when the Repeater object loads the first time. The recycleChildren property improves performance only for subsequent changes to the Repeater control’s data provider. If you know that your Repeater object creates children only once, you do not have to use the recycleChildren property or worry about the stale state situation.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值