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

被折叠的 条评论
为什么被折叠?



