Sorry, I think I mis-wrote.  At the time the renderer's
updateDisplayList is called, the DataGrid has placed it and sized it
according to its columnwidth and rowheight.  If you then move it to the
left and make it wider, you might be able to get away with it.
Apparently someone did.
 
The alternate approach I suggested was to put the wide renderer in the
left column and just make it wider, then shrink the other columns that
would overlay it.
 
Good luck,
-Alex

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Gareth Edwards
Sent: Thursday, February 08, 2007 8:42 PM
To: [email protected]
Subject: Re: [flexcomponents] Best way to create a datagrid with
collapsible grouped panels



Tried the column span concept, and I can't seem to get it to work. I
can't seem to draw content into negative coords within a cellrenderer
because it seems to just clip the content? Could you provide any
additional information on how this technique is possible? 

Cheers
Gareth.


On 2/2/07, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
wrote: 

        

        A Grid container creates a row for every child.  The DataGrid
only creates a row for every visible child.  The difference is
significant for very large data sets.  However, because Grid rows can be
anything, it can be easier to customize your appearance.

         

        Various folks have put together Tree/DataGrid combinations.  See
farata systems for an excellent example.  You might just want to use
their stuff.

         

        If you want to grow your own, other folks have done column span.
The key is that the right column is at the top of the z-order for a row,
and there is no clipping so it can actually draw itself into negative
coordinates obscuring the columns to the left.

         

        Various other folks have built Collection wrappers that fake
rows in a collection so they can insert group data items.  Their
renderers then detect that and draw themselves differently.

         

        Below is code from a two-line header where it showed a title on
top and revenue/profit on the second row.

         

                    private var revenue:UITextField;

                    private var profit:UITextField;

                    private var title:UITextField;

         

                    override protected function createChildren():void

                    {

                                super.createChildren();

         

                                revenue = new UITextField();

                                revenue.text = "Revenue";

                                addChild(revenue);

                                profit = new UITextField();

                                profit.text = "Profit";

                                addChild(profit);

                                title = new UITextField();

                                addChild(title);

                    }

         

                    override protected function commitProperties():void

                    {

                                super.commitProperties();

         

                                var c:DataGridColumn =
DataGridColumn(data);

                                title.text = c.headerText;

         

                    }

         

                    override protected function
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

                    {

                                super.updateDisplayList(unscaledWidth,
unscaledHeight);

         

                                revenue.setActualSize(unscaledWidth/2,
unscaledHeight);

                                revenue.move(0, unscaledHeight - 22);

                                profit.setActualSize(unscaledWidth/2,
unscaledHeight);

                                profit.move(unscaledWidth/2,
unscaledHeight - 22);

                                title.move(unscaledWidth/2 -
title.textWidth/2, 0);

                                title.setActualSize(title.textWidth + 4,
title.textHeight + 4);

                    }

         

        -Alex

         

        
________________________________


        From: [email protected]
<mailto:[email protected]>
[mailto:[email protected]
<mailto:[email protected]> ] On Behalf Of leds usop
        Sent: Wednesday, January 31, 2007 10:48 PM
        To: [email protected]
<mailto:[email protected]> 
        Subject: Re: [flexcomponents] Best way to create a datagrid with
collapsible grouped panels

         

        Have you considered using Grid instead as the base
        class instead of datagrid?
        
        --- Gareth Edwards <[EMAIL PROTECTED]
<mailto:ghedwards%40gmail.com> > wrote:
        
        ---------------------------------
        
        So you've got some ideas on how to go about doing
        this?
        
        Cheers
        Gareth.
        
        Andrew D. Goodfellow wrote: 
        Gareth,
        
        I was beginning to look into doing this as well.
        Perhaps we should worktogether on it?
        
        -Andy
        
        
        On 1/31/07, Gareth Edwards <[EMAIL PROTECTED]
<mailto:ghedwards%40gmail.com> >
        wrote: 
        Would like to attempt to extend the datagrid control
        to allowfor a 
        number of things.
        
        If anyone has suggestions or snippets of code on how
        to make these 
        possible, it would be much appreciated.
        
        1) Panel type layout within the datagrid allowing for
        grouping and 
        collapsing of datasets.
        2) Extension of the grid header to allow for an
        additional customizable 
        header row.
        
        Both the group headers and grid headers need to span
        the width of thegrid.
        
        If no one has done this before, suggestions would be
        much appreciated.I 
        have started attempting to implement these features,
        but it seems the 
        datagrid is some what more complex than other
        controls.
        
        Cheers
        Gareth.
        
        
        
        
        
        
        
        
        
        __________________________________________________________
        Yahoo! Music Unlimited
        Access over 1 million songs.
        http://music.yahoo.com/unlimited
<http://music.yahoo.com/unlimited> 

        

        

        


 

Reply via email to