flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kyle McKnight <kamck...@gmail.com>
Subject Re: Clearing List Control
Date Thu, 29 Sep 2016 20:52:57 GMT
Did you try list.selectedIndices = []?

The documentation says that the default value is []. So I looked at the
source for List for selectedIndices setter. Looks like if value is null, it
won't set the indices, so it won't get updated.

if (value)
     _proposedSelectedIndices = value;
else
     _proposedSelectedIndices = new Vector.<int>();




Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Thu, Sep 29, 2016 at 4:47 PM, Matthew Weir <mattcommark@yahoo.com.invalid
> wrote:

> Apparently this works,  But I don't understand why you just can't say the
> selectedIndicies are null or new Vector<int>
> var ac:ArrayCollection = new ArrayCollection(ObjectUtil.copy((list.dataProvider
> as ArrayCollection).source) as Array);
> ac.refresh();list.dataProvider = ac;
>
>     On Thursday, September 29, 2016 4:31 PM, Matthew Weir
> <mattcommark@yahoo.com.INVALID> wrote:
>
>
>  I'm stumped guys.  I must be missing something completely, ridiculously,
> easy.
> list.selectedIndices = new Vector.<int>();
>                 var ac:ArrayCollection = list.dataProvider as
> ArrayCollection;
>                 list.dataProvider = null;
>                 ac.refresh();
>                 list.selectedIndices = null;
>                 list.selectedIndex = -1;
>                 list.dataProvider = ac;
>                 list.invalidateDisplayList();
>                 list.validateNow()
> Still shows selected items.
> Help!  Please :)
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message