Hello all. I have a form where a user enters criteria and chooses from a list box the columns they want to see in their search results (in the form of a datagrid). The List of columns is linked to <mx:model> in a XML file.
I am able to generate the datagrid successfully along with cell renderers, but I am not sure how to dynamically add a "labelFunc" b/c there are several columns where I need to process the value before displaying. My code looks like this: // Code to create Datagrid // Loop through the 'column' objects defined in my xml Model and // call createDataGridColumn method. /* create column */ function createDataGridColumn(column : Object) : DataGridColumn { var _dgc:DataGridColumn = new DataGridColumn(column.name); _dgc.headerText = column.headerText; _dgc.width = column.width; if(column.labelFunction != undefined) { _dgc.labelFunction = column.labelFunction; //_dgc.labelFunction = "displayText"; } return _dgc; } THE QUESTION OF THE HOUR is that the _dgc.labelFunction line within the if statement is assigned the text of the method name, for example, in the commented line below. So where do I place the implementation of this method??? The following attempts by me didn't work: 1.) I tried extending the DataGridColumn class and implementing the method there. 2.) Implement the method in the class of the code above. 3.) Implement the method in the calling class of the code above. Thanks in advance for any help! 3. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/