wiht the datagrid you put the datagridcolumns into an array and then set the
datagrid.columns property
On Wed, Jul 23, 2008 at 8:47 AM, Rafael Faria <[EMAIL PROTECTED]>
wrote:
> Is there anyway to create "components" on the fly?
>
> Let me explain what i mean.
>
> I have a datagrid that has like 5 columns. Each one of them use a
> different itemrenderer.
>
> I understand that i can create each itemrenderer on a different file
> but what if i don't want to create files?
>
> is there anyway to transform the following code in a dynamically code
> without create any files?
>
> <mx:DataGridColumn headerText="Name">
> <mx:itemRenderer>
> <mx:Component>
> <mx:Text text="{data.lname + ', ' + data.fname}" />
> </mx:Component>
> </mx:itemRenderer>
> </mx:DataGridColumn>
>
> ??
> How can i do that without creating any other files? i would imagine
> something like
>
> var dgc:DataGridColumn = new DataGridColumn();
> var mycomponent:Component = new Component();
> var txt:Text = new Text();
> txt.text = "Somthing here";
> mycomponent.addChild(txt);
>
> var render:ClassFactory = new ClassFactory(mycomponent);
> dcg.itemRender = render;
>
> i know that this code doesnt work but it's just to have an idea of
> what i was thinking.
>
> Is there anyway to do that?
>
> Thanks
> Rafael
>
>
>
--
j:pn
\\no comment