Hello Kyle,

If you want to use the refresh() method, a solution would be to :

1 - Store the verticalScrollPosition value of the scroller of the list (verticalScrollPosition is a property you can access via the viewport property of the scroller)
2 - Invoke the refresh method of the data provider
3 - Wait for the updateComplete event of the list
4 - Restore the verticalScrollPosition value to the stored one

Cheers.


Le 24/10/2016 à 23:00, Kyle McKnight a écrit :
How am I doing that?
The underlying data within an ArrayList gets updated. The ArrayList is the
data provider to the List.

Ya don't do that.
OK :-D

The suggestion given I believe would rely on binding which I'm trying to
avoid. I hate littering my code with bindings and am only using Flex
because I am required to for who I'm writing it for :) So I need a way to
tell the item renderer that it needs to update and the only way I
originally knew how was to refresh the entire list rather than just the
one.


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Mon, Oct 24, 2016 at 4:13 PM, Clint M <[email protected]> wrote:

Inline below

On Mon, Oct 24, 2016 at 11:53 AM, Kyle McKnight <[email protected]>
wrote:

Hey everyone!

I have a List that has enough items that one must scroll down to see them
all.

When clicking an item, it updates the data for that ItemRenderer with a
quantity value.

How are you doing that.


When this happens, I'm calling refresh() on the data provider for the
List
but this refreshes then entire List and causes it to scroll back up to
the
top.

Ya don't do that.


Is there a way to only update the single ItemRenderer whose data
changed? Or is there some other way around this?

It depends on how you're doing it in my first question but generally
something like that would just be handled in the itemRenderer like:

data.quantity = newVal; <-- this will also trigger a collectionChange event
on the lists dataProvider that you could handle

If you're bubbling a click event up and trying to handle it in a controller
then you could do something like:

list.dataProvider[itemRenderer.itemIndex].quantity = newValue;


Thanks!

Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)


Reply via email to