[ 
https://issues.apache.org/jira/browse/FLEX-33708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Colin Childs closed FLEX-33708.
-------------------------------

    Resolution: Not A Problem

Although this behaves differently than previous versions of Flex, the state of 
an ArrayCollection after removing its sort cannot be guaranteed. Marking this 
as Not a Problem

> ArrayCollection addItemAt() does not work correctly after removing sort
> -----------------------------------------------------------------------
>
>                 Key: FLEX-33708
>                 URL: https://issues.apache.org/jira/browse/FLEX-33708
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Collections
>    Affects Versions: Apache Flex 4.10.0
>         Environment: Tested on Windows 7 with AIR simulator and on iPhone 5
>            Reporter: Colin Childs
>              Labels: ArrayCollection, flex4.10
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> After sorting an ArrayCollection, removing the sort, then adding an item at 
> an index always adds it to the end of the list. I ran into this while sorting 
> a dropdown alphabetically, then setting the ArrayCollection's sort to null, 
> and trying to add something at the top of the list, such as "Select One". 
> This works fine in Flex 4.6.
> Here is a simple example (and workaround):
> var col:ArrayCollection = new ArrayCollection();
> col.addItem("1");
> col.addItemAt("2", 0); //works as expected
> col.addItemAt("3", 2); //works as expected
>                               
> col.sort = new Sort();
> col.refresh();
> col.sort = null;
>                               
> //workaround:
> //var temp:ArrayCollection = new ArrayCollection(col.toArray());
> //col = temp;
>                               
> col.addItemAt("0", 0);



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to