0 Replies Latest reply on May 12, 2011 2:18 AM by jd_ice

    A question about AdvancedDatagridColumnGroup

    jd_ice Level 1

      Hi guys,

       

           Just a quick question about AdvancedDatagridColumnGroup, is the children property only allowed to have an AdvancedDatagridColumn on it?

       

      Because what I'm trying to do is in my recursive function I'm trying to create a nested AdvancedDataGridColumnGroup, all good until I set the ADG's groupedColumns to a certain array which is a return array of the recursive function. It throws out an exception something in the groupedValidation function of ADG.

       

      Here's the code that does that

       

      var createColumnGroup:Function = function( group:Array, xml:* ) : Array

                              {

                                    var ret:Array = new Array;

                                    var colGroup:AdvancedDataGridColumnGroup = newAdvancedDataGridColumnGroup;

                                    for(var index:int = 0; index < 1; ++index){

                                        

                                          var parts:Array = String(group[index]).split(DELIMITER);

                                        

                                          if(parts.length){

                                                colGroup = new AdvancedDataGridColumnGroup;

                                                colGroup.headerText = parts[0];

                                                colGroup.children = [];

                                                var curHeader:String = parts[0];

                                              

                                                parts.splice(0,1);

                                              

                                                                                           //this is the part where I'm trying to nest the advancedDataGridColumnGroup

                                                                                           // what's to be replaced in this line to make a valid nest of ADGColumnGroup?

                                                if( parts.length > 0){

                                                      colGroup.children.push( createColumn([parts.join(DELIMITER)], xml));

                                                }

       

                                                                                  ret.push( colGroup )

                                          }   

                                    }

                                  

                                    return ret;

       

                                              }

       

      and I call it like this

       

      var gCols:Array = createColumn( colsArr, new XML(_xml.children()[0].toString()));

                            

      adg.groupedColumns = gCols;

       

       

      Best Regards,

       

      jd