I would but i wan't to do it FROM actionscript and not from the mxml. Like i said i want it being created on the fly.
How would you do that from actionscript? Rafael --- In [email protected], "Josh McDonald" <[EMAIL PROTECTED]> wrote: > > I don't see why you don't just use <mx:component> like in your first > example? You don't need to make any extra files. Or are you building your > entire datagrid programatically? > > -Josh > > On Thu, Jul 24, 2008 at 9:16 AM, Rafael Faria <[EMAIL PROTECTED]> > wrote: > > > Hi Johannes, > > > > Thanks for your reply but my question isn't really about how to put > > the columns into the datagrid. It's actually how to create dynamically > > components to put inside the columns. > > > > See i don't want to create 4,5,6,7 different itemrenderes files so i > > can insert into the columns i would create them on the fly, > > programmatically . Does it make sense? > > > > Anyone have some idea about it?! > > > > Thanks > > Raf > > > > > > --- In [email protected], "Johannes Nel" <johannes.nel@> > > wrote: > > > > > > 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 <rafaelfaria.grupos@> > > > 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 > > > > > > > > > > > ------------------------------------ > > > > -- > > Flexcoders Mailing List > > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > Search Archives: > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > > Links > > > > > > > > > > > -- > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > :: Josh 'G-Funk' McDonald > :: 0437 221 380 :: [EMAIL PROTECTED] >

