Search code examples
actionscript-3apache-flexmxml

What is the format to add an item to an XMLListCollection?


I'm trying to create an add row button, and lots of the examples I have seen mention adding an item to the end of the dataProvider. So far, all of these examples have used ArrayCollections, but for my use, XMLListCollection works better. What is the format when adding and item to the XMLListCollection? Is it the same as an ArrayCollection?

Thanks!


Solution

  • Is it the same as an ArrayCollection?

    Yes. You can see in the documentations that both XMLListCollection and ArrayCollection extend and get most of their functionality from ListCollectionView, which includes the following methods:

    • addAll(addList:IList):void
    • addAllAt(addList:IList, index:int):void
    • addItem(item:Object):void
    • addItemAt(item:Object, index:int):void