Yeah, I think your could subclass it and override updateDisplayList for what
you're needing. Check this out and see if it does what you need:
package nes
{
import mx.controls.advancedDataGridClasses.AdvancedDataGridHeaderRenderer;
public class AdvancedDataGridHeaderRendererExt extends
AdvancedDataGridHeaderRenderer
{
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
graphics.moveTo(0, unscaledHeight);
graphics.lineStyle(2, 0xFF0000);
graphics.lineTo(unscaledWidth, unscaledHeight);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:nes="nes.*"
layout="vertical"
>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable] private var d:ArrayCollection = new ArrayCollection([
{value: 1, summaryRow:false},
{value: 2, summaryRow:false},
{value: 3, summaryRow:false},
{value: 4, summaryRow:false},
{value: 5, summaryRow:false},
{value: 6, summaryRow:false},
{value: 21, summaryRow:true}
]);
]]>
</mx:Script>
<mx:AdvancedDataGrid dataProvider="{d}" height="100%">
<mx:columns>
<mx:AdvancedDataGridColumn dataField="value" headerText="title">
<mx:headerRenderer>
<mx:Component>
<nes:AdvancedDataGridHeaderRendererExt horizontalAlign="right"/>
</mx:Component>
</mx:headerRenderer>
</mx:AdvancedDataGridColumn>
</mx:columns>
</mx:AdvancedDataGrid>
</mx:Application>
On Mon, Sep 15, 2008 at 4:48 PM, whatabrain <[EMAIL PROTECTED]> wrote:
> Thanks! That fixed most of my problems, and could fix my "sort arrow"
> problem when I get to it.
>
> But I'm having an absurd amount of trouble drawing a thick horizontal
> line under the headers. The best I could do was add a Shape object to
> the display list in the header renderer, but that had gaps in it
> where the header separators were, and interacted very poorly with
> word wrap.
>
> Any ideas? Should I be overriding the AdvancedDataGrid's renderer?
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, "Pan
> Troglodytes"
> <[EMAIL PROTECTED]> wrote:
> >
> > Check out the help for AdvancedDataGridHeaderRenderer. That's what
> the grid
> > is using by default. It should show all the styles there. The
> following
> > code worked as expected:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> > layout="vertical"
> > >
> > <mx:Script>
> > <![CDATA[
> > import mx.collections.ArrayCollection;
> > [Bindable] private var d:ArrayCollection = new ArrayCollection
> ([
> > {value: 1, summaryRow:false},
> > {value: 2, summaryRow:false},
> > {value: 3, summaryRow:false},
> > {value: 4, summaryRow:false},
> > {value: 5, summaryRow:false},
> > {value: 6, summaryRow:false},
> > {value: 21, summaryRow:true}
> > ]);
> > ]]>
> > </mx:Script>
> >
> > <mx:AdvancedDataGrid dataProvider="{d}" height="100%">
> > <mx:columns>
> > <mx:AdvancedDataGridColumn dataField="value"
> headerText="title">
> > <mx:headerRenderer>
> > <mx:Component>
> > <mx:AdvancedDataGridHeaderRenderer
> horizontalAlign="right"/>
> > </mx:Component>
> > </mx:headerRenderer>
> > </mx:AdvancedDataGridColumn>
> > </mx:columns>
> > </mx:AdvancedDataGrid>
> > </mx:Application>
> >
> >
> > On Mon, Sep 15, 2008 at 1:12 PM, whatabrain <[EMAIL PROTECTED]> wrote:
> >
> > > I'm having trouble getting my AdvancedDataGrid's header to look
> like
> > > I want, and I can't seem to find any reference for what styles are
> > > allowed in the "headerStyleName" class. Worse, I've found that
> some
> > > styles (like headerColors) can only appear in the table body's
> style.
> > > Here are the things I'm trying to do:
> > >
> > > 1) Left-aligned text (text-align doesn't work).
> > >
> > > 2) Lighter gray borders (borderColor doesn't work).
> > >
> > > 3) A thick, solid black line below the headers (border-thickness-
> > > bottom doesn't work).
> > >
> > > 4) Word wrap.
> > >
> > > 5) If possible, a Windows-style sort arrow on column headers,
> instead
> > > of the wierd blocked-off sort arrow used by Flex. I'm guessing I'd
> > > need a skin for this.
> > >
> > > Is there a good reference somewhere on Flex CSS?
> > >
> > >
> > >
> >
> >
> >
> > --
> > Jason
> >
>
>
>
--
Jason