Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-26438

ArrayCollection - setItemAt API malfunctioning when it has filter function

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK 4.1 (Release)
    • Apache Flex 4.10.0
    • Collections
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:

      1.Create an ArrayCollection instance with any data

      public var dp:ArrayCollection = new ArrayCollection( [

      {label:'santosh'}

      ,

      {label:'kumar'}

      ]);

      2.Create any filter function

      dp.filterFunction = function (itemA:Object):Boolean {
      return true;
      }
      dp.refresh();

      3. Swap elements in the following order

      var item1:Object = dp.getItemAt(0);
      var item2:Object = dp.getItemAt(1);

      dp.setItemAt(item2,0);
      dp.setItemAt(item1,1);

      Actual Results:

      Swapping failed

      {label:'santosh'}

      ,

      {label:'kumar'}

      Expected Results:

      {label:'kumar'}

      ,

      {label:'santosh'}

      Workaround (if any):

      When ArrayCollection has filter function attached to it then Use setItemAt API swap the elements starting from the highest order to the lowest.

      Do this:
      dp.setItemAt(item1,1);
      dp.setItemAt(item2,0);

      Don't do:
      dp.setItemAt(item2,0);
      dp.setItemAt(item1,1);

      This issue can been reproduced even in previous version of Flex SDK's.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: