将项目添加到 XMLListCollection 的格式是什么?

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

我正在尝试创建一个添加行按钮,我看到的很多示例都提到了将一个项目添加到 dataProvider 的末尾。到目前为止,所有这些示例都使用了 ArrayCollection,但对于我来说,XMLListCollection 效果更好。向 XMLListCollection 添加和项目时的格式是什么?它与 ArrayCollection 相同吗?

谢谢!

Is it the same as an ArrayCollection?

是的。可以在文档中看到XMLListCollection and ArrayCollection extend and get most of their functionality from ListCollectionView,其中包括以下方法:

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