The case scenarion is like this:
var col:ICollectionView = new ArrayCollection(); col.addItem("California"); col.addItem("Arizona"); var sort:Sort = new Sort(); // There is only one sort field, so use a null first parameter. sort.fields = [new SortField(null, true)]; col.sort = sort; col.refresh();//now add an item at the 0 th index
col.addItemAt("Alaska",0);//The above statment simply fails, it adds the item at last position
//The reason is you cannot use addItemAt() after applying a sort to the ArrayCollection. It simply
// adds to the end. Ignore either sorting or adding an item.
No comments:
Post a Comment