Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Adobe Flex SDK 4.1 (Release)
-
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.