I have this ArrayCollection filled with a xml data coming from and HttpService request.
The generated XML
<items>
<item>
<id>1</id>
<name>Tom</name>
</item>
<item>
<id>2</id>
<name>Jerry</name>
</item>
<item>
<id>3</id>
<name>TV</name>
</item>
</items>
The script
[Bindable] private var dp:ArrayCollection;
private function onResult(event:ResultEvent):void{
dp = event.result.items.item;
}
Right, this dp is used as a dataProvider in a ComboBox
Is there a way to add another element (at the begining) of this ArrayCollection ?
I tried using unshift, but that only worked for an Array
Thanks.
Use
addItemAtmethod.