You need to specify the classes so that
they will get linked in. If Flex doesn’t see a class reference it doesn’t
know to link it into the SWF. Roger has an article on DevNet that goes into
this in great detail.
Matt
From: viraf_bankwalla
[mailto:[EMAIL PROTECTED]
Sent: Saturday, February 26,2005
10:27 AM
To: [email protected]
Subject: [flexcoders] Specifying
renderers in DataGrid
Hi,
I have the following code that is called to create
DataGridColumn's
var col:mx.controls.gridclasses.DataGridColumn;
col = new
mx.controls.gridclasses.DataGridColumn(cname);
col.columnName=cname;
col.headerText=cname;
col.cellRenderer="MyCellRenderer";
col.headerRenderer="MyHeaderRenderer";
grid.addColumn(col);
I have noticed that when I specify the renderers
as a String the
columns are not rendered. However, if I
simply specify the class as:
col.cellRenderer=MyCellRenderer;
col.headerRenderer=MyHeaderRenderer;
They are being instantiated. Could someone
please explain the
difference. The renderers were createdas
MXML and have the
setValue method in a script.
Thanks.
|