If I understand your problem correctly you just need column groups.

http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_09.html

--- In [email protected], wpageiii <bi...@...> wrote:
>
> 
> I am having some issues creating AdvancedDataGridColumnGroup (ing) in
> Actionscript...
> 
> Here is what I have tried...
>                               var length : int = Storesdp.length;
>                                       for( var i : int = 0; i < length; i++ )
>                                       {
>                                       oColumnDef_amt = new 
> AdvancedDataGridColumn(i+"_amt");
>                                       oColumnDef_amt.headerText = "Amount"
>                                       oColumnDef_amt.dataField = 
> "S"+Storesdp.getItemAt(i).data+"_amt";
>                                       oColumnDef_amt.width = 100;
>                                       oColumnDef_amt.sortable = true;
>                                       oColumnDef_amt.visible = true;
>                                       oColumnDef_amt.editable = false;
>                                       oColumnDef_amt.wordWrap = false;
>                                       oColumnDef_amt.labelFunction = 
> amtLabelFunction;
>                                       
> oColumnDef_amt.setStyle("textAlign","right");
>                        
>                                       colArray.push(oColumnDef_amt);
> 
>                                       oColumnDef_cnt = new 
> AdvancedDataGridColumn(i+"_cnt");
>                                       oColumnDef_cnt.headerText = "Count";
>                                       oColumnDef_cnt.dataField = 
> "S"+Storesdp.getItemAt(i).data+"_cnt";
>                                       oColumnDef_cnt.width = 50;
>                                       oColumnDef_cnt.sortable = true;
>                                       oColumnDef_cnt.visible = true;
>                                       oColumnDef_cnt.editable = false;
>                                       oColumnDef_cnt.wordWrap = false;
>                                       //oColumnDef.labelFunction = 
> amtLabelFunction;
>                                       
> oColumnDef_cnt.setStyle("textAlign","right");
>                        
>                                       colArray.push(oColumnDef_cnt);
> 
> var columnGroup:AdvancedDataGridColumnGroup=new
> AdvancedDataGridColumnGroup(String(i));
>                                       
> columnGroup.headerText=Storesdp.getItemAt(i).label;
>                                       
> columnGroup.children.push(oColumnDef_amt);
>                                       
> columnGroup.children.push(oColumnDef_cnt);
>                                       colArray.push(columnGroup);             
>                         
>                                       }
>                       _columns = colArray;
>                       adg.columns = _columns;
> 
> I am getting 3 columns for each loop, my Column Group appears as its own
> column...It seems like I am close to having this solved but missing some
> important piece....A nudge in the right direction is welcomed...
> -- 
> View this message in context:
http://www.nabble.com/AdvancedDataGridColumnGroup-dynamically-speaking-tp22111914p22111914.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>


Reply via email to