This content has been marked as final. Show 4 replies
Flex itemRenderers are only created for the visible rows of a list control, plus one or two extra for recycle buffering. The itemRenderers are recycled as the user scrolls the list. For example, if you have 1000 items but only 10 rows visible, then only 11 or 12 itemRenderers are created. At first they show records 1-10. As the user scrolls, the data for record 1 scrolls out of view, but the itemRenderer that was showing that data is moved to the bottom of the list area and is given the data for row 11. The itemRenderers for records 2-10 are shifted upward.
Sorting the list simply causes the itemRenderers to receive new data - they generally do get moved to new locations as the result of a sort of a filter.
If you add event listeners on the parentDocument you may be getting very confused and mismatched data and events as the list is scrolled.
Is there a way to overcome this and control the data in the itemrednerers even if they are not visible?
I can see no way to do this. Why do you want to add en event listener to the parent document? Perhaps there is another way to approach the problem you are trying to solve.
If you force the whole number of lines in the datagrig to be displayed (by setting an appropriate height to the datagrid), I tihnk you can force every itemRenderers'creation just once.