Thanks Clint. I should have mentioned it was for 2.0 that I wanted
the answer anyways so will be interested to see what you come up with

I see from the flex2 examples that they have taken on board the column
locking that Steve Webster hacked for 1.5. Hopefully thsy can upgrade
for this also by the time the final 2.0 comes out. Seems strange that
what for HTML would just be one more <th> line is such a lot of work
in Flex. Also that alignment cannot vary between a column header and
its contents

Their samples also say they cover column header wrapping but their
example (and my experiments) only wraps the cell data  


--- In [email protected], Clint Modien <[EMAIL PROTECTED]> wrote:
>
> And o ya...  the most important part... the data.
> 
data snipped as so big - see thread for details
> 
> 
> On 12/17/05, Clint Modien <[EMAIL PROTECTED]> wrote:
> >
> > Did this the other day... here's some code... with a warning
though.  The
> > performance is horrible on my 1.7 GHz Pentium M laptop running the
7.xdebug player. It takes about 6 seconds to load what I would call a
"very"
> > small subset of data (45KB).  Maybe someone from MM can have a
look at it
> > and see if it can be optimized. Most of what I did was inspired by
the grid
> > that Steven Webster had on his blog here:
> >
> > http://www.richinternetapps.com/archives/000101.html
> >
> > I'm in the process of converting it to a Flex 2.0 app.  *i hope it
runs
> > faster there* I'll post that too once I'm finished.
> >
> > Here's the example...
> >
> > ---------------- App.mxml -------------------
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx=" http://www.macromedia.com/2003/mxml";
> >         creationComplete="this_creationComplete()"
themeColor="haloBlue"
> >     backgroundColor="#707070" xmlns="*" >
> >     <mx:Panel title="Panel1" label="Panel1" height="100%"
width="100%" >
> >         <mx:Button id="loadTestDataButton" label="Load"
> > click="loadTestDataButton_click()" />
> >         <MultiGrid height="100%" width="100%" dataProvider="{
> > ModelLocator.rootObj}" />
> >     </mx:Panel>
> >     <mx:HTTPService id="testService" showBusyCursor="true"
> > useProxy="false"
> >         url="@ContextRoot()/test2.xml" resultFormat="object"
> >         result="ModelLocator.rootObj = event.result.root;" />
> >     <mx:Script source="App.as" />
> > </mx:Application>
> >
> > ---------------- MutiGrid.mxml -------------------
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:HDividedBox xmlns:mx="http://www.macromedia.com/2003/mxml";
> > marginTop="0" marginBottom="0">
> >     <mx:VBox height="100%" width="33%" marginTop="20">
> >         <mx:DataGrid id="leftGrid" dataProvider="{ModelLocator.data}"
> > height="100%" width="100%"
> >         selectedIndex="{lowerGrid.selectedIndex}" hScrollPolicy="on"
> > vScrollPolicy="off"
> >             vPosition="{lowerGrid.vPosition}">
> >             <mx:columns>
> >                 <mx:Array>
> >                     <mx:DataGridColumn headerText="Name"
columnName="name"
> > />
> >                     <mx:DataGridColumn headerText="Group"
> > columnName="group" />
> >                 </mx:Array>
> >             </mx:columns>
> >         </mx:DataGrid>
> >     </mx:VBox>
> >     <mx:Canvas height="100%" width="66%" verticalGap="-1">
> >         <mx:DataGrid id="upperGrid" hPosition="{lowerGrid.hPosition}"
> > textAlign="center"
> >             hScrollPolicy="on"  height="40" width="100%"
> > vScrollPolicy="on"  />
> >         <mx:DataGrid id="lowerGrid" dataProvider="{ModelLocator.data}"
> > height="100%" width="100%"
> >             vScrollPolicy="on" hScrollPolicy="on" y="19"
selectedIndex="{
> > leftGrid.selectedIndex}" />
> >     </mx:Canvas>
> >     <mx:Script source="MultiGrid.as"/>
> > </mx:HDividedBox>
> >
> > ---------------- MutiGrid.as -------------------
> >
> >     import mx.controls.gridclasses.DataGridColumn;
> >
> >     public function set dataProvider(val:Object)
> >     {
> >         //make sure we're getting array's
> >         var data    =
mx.utils.ArrayUtil.toArray(val.GridDataSet.GridData);
> >         var columns = mx.utils.ArrayUtil.toArray(val.Columns.Column);
> >         //format the grids first
> >         renderColumns(columns);
> >         //then bind the child props to the ModelLocator
> >         ModelLocator.data = data;
> >     }
> >
> >     private function renderColumns(columns:Array)
> >     {
> >         upperGrid.removeAllColumns();
> >         lowerGrid.removeAllColumns();
> >         var columnNumber = 0;
> >         for (var i = 0; i < columns.length; i++)
> >         {
> >             // add columns to the uppergrid
> >             var columnWidth = 100;
> >             var column = columns[i];
> >             var subColumns:Array = mx.utils.ArrayUtil.toArray (
> > column.SubColumn);
> >             var dc = new DataGridColumn();
> >             dc.headerText = column.ColumnName;
> >             dc.width = subColumns.length * columnWidth;
> >             dc.colNum = i;
> >             upperGrid.addColumn(dc);
> >             // add columns to the lower grid
> >             for (var j = 0; j < subColumns.length; j++)
> >             {
> >                 var subColumn = subColumns[j];
> >                 if(subColumn == undefined) subColumn = "";
> >                 var dc2 = new DataGridColumn();
> >                 dc2.colNum = columnNumber;
> >                 columnNumber++;
> >                 dc2.headerText = subColumn;
> >                 // dc.setStyle("textAlign", "center");
> >                 dc2.columnName =
"Column_"+column.ColumnID+"_"+subColumn;
> >                 dc2.width = columnWidth;
> >                 lowerGrid.addColumn(dc2);
> >             }
> >         }
> >     }
> >
> > ---------------- ModelLocator.as -------------------
> >
> > class ModelLocator
> > {
> >     public static var rootObj;
> >     public static var data:Array;
> > }
> >
> >
> > On 12/16/05, yaagcur < [EMAIL PROTECTED]> wrote:
> > >
> > > Couple of points
> > >
> > > a) It seems to me that if I textAlign="right" a DataGridColumn then
> > > the column header automatically follows that designation even if I
> > > want it to be textAlign="center" and have entered it so in DataGrid
> > >
> > > b) How can I have two rows of headers so that the lower row can be a
> > > subdivision of higher one
> > >
> > > e.g
> > >               Goals Scored
> > >               Home   Away
> > >                 16     8
> > >                  ..    ..
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > 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
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/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