Husain Kitabi wrote:

> I tried to use
>   <mx:DataGridColumn columnName="classgroupVenue" 
> headerText="Classgroup Venue" />
>     <mx:DataGridColumn columnName="classgroupCapacity" 
> headerText="Classgroup Capacity"/>
>     <mx:DataGridColumn columnName="module.moduleName" 
> headerText="Module"/>
>
>  
> The first 2 columns are fine. But module.moduleName - it does not 
> display anything. Has anybody done something like this. Pl advise.


You need to create a custom cell renderer.  The default cell renderer 
only allows you to go "1 deep" into an object, so you have to createa 
cell renderer that can understand column names that use a path to get 
deeper into a object.

Heres some partial code to give you an idea.. the entire cell renderer 
will be found in Flex By Example with sample usage.  This code would go 
inside a "PathCellRenderer.as" file that creates a Label component to 
render text.

        private function setValue( str:String, item:Object, selection:String 
):Void
        {
                if ( item == undefined ) {
                        label.visible = false;
                        return;
                }
        
                label.visible = true;
                
                // Split up the complex path into pieces
                var path = getDataLabel().split(".");
                // "dot down" to the item to display
                var toDisplay = item[ path[0] ];
                for ( var i:Number = 1; i < path.length; i++ ) {
                        toDisplay = toDisplay[ path[i] ];
                }
                
                label.text = toDisplay;
        }


Flex by example will ship on October 24th, I believe.  :-)

-d



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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/
 




Reply via email to