--- In flexcoders@yahoogroups.com, nwebb neilw...@... wrote:
Hi,
I have 2 List components on a page.
The one on the left displays the names of some bundles - e.g.
*Bundle 1*
The one on the right displays the items in the selected bundle, plus a
percentage value - e.g. *item1 - 10%* *item2 - 55%*
*item3 -
61%*
The items are the same for all bundles, but their percentages may
change as
the user selects different bundles. If that happens I want to
highlight that
itemRenderer. (eg when the percentage changes, highlight renderer)
I looked at a similar example from Alex Harui - he compares a DataGrid's
listData.UID to the previous UID (stored as a property on the
renderer). If
they match, he knows he has the same item and changes that value.
I have implemented IDropInListItemRenderer (so I have access to the
UID) but
the renderer-recycling of the List means that even when the UID's
match, the
oldPercent value I stored doesn't actually match up to item being
displayed - in other words, the renderer which previously displayed
*item1
- 10%* may now be displaying *item3 - 61%* , so the percentage HAS
changed, but that's because it's displaying a different item!
Is my only option to send both the new% and old% in via the
dataprovider, or
is there another way to get around this issue?
Cheers
Could you use a static Dictionary on the itemRenderer class, with the
key being the UID?
That way you can get the old% value regardless of whether you're in
the same renderer instance?