Wednesday, March 13, 2013

Flex : Updating a dataGrid when arrayCollection is modified.

Datagrid and ArrayCollection are Bindable with each other.
Hence if we add or remove elements to the ArrayCollections, Datagrid will update Automatically.

But, We need to bind them using [Bindable] tag.

example:

[Bindable]
private var ac:ArrayCollection;

private function init():void
{
      ac = new ArrayCollection(<xml file link or items>);
      dg.dataProvider = ac;
}

<Datagrid creationComplete = "init();" />

No comments:

Post a Comment