myDG.dataProvider={ myData }

On 7 Jul 2008, at 16:26, limhy0306 wrote:

Hi,

I've created a custom Dynamic Datagrid component. I would like to
ask, how can I bind data to this DG?

My codes:

// Data to the datagrid. This data is dynamically changing.
[Bindable]
public var myData:ArrayCollection();

public var myDG:MyDG;

// Called when creationComplete
private function init()
{
myDG = new MyDG();
myDG.createDataGrid(); // Create the datagrid
myDG.dataProvider = myData; //Would this bind the data?
this.addChild(myDG);
}

I've noticed that when myData changed, myDG is not updated. In fact,
the set data() function of the ItemRenderer used in myDG is not
being called when I call myData.refresh().

Is it the problem that I am not binding myDG correctly?

Thank you.




Reply via email to