Hello, 

I have been trying to setup the tree function of that advanced
datagrid but keep running into problems. 

I get the error:
TypeError: Error #1034: Type Coercion failed: cannot convert
[EMAIL PROTECTED] to mx.collections.ICollectionView.



I have made some progress, Now instead of getting no data populating
the Advanced Datagrid I get a single Folder that says "Not Available"







public function handleResultRecords(event:ResultEvent):void{

        records = new XMLListCollection(event.result.ini.record);               
        

                        var fields:Array = [];
                        fields.push(new GroupingField("record"));

                        gc = new GroupingCollection();
                        gc.source = records;
                        
                        gc.grouping = new Grouping();                   
                        gc.grouping.fields = fields;
                        gc.refresh(true);                       
                        adg.dataProvider = gc;
   }                    



<mx:AdvancedDataGrid id="adg" designViewDataType="tree" height="100%"
width="100%"> 
 <mx:columns>                           
   <mx:AdvancedDataGridColumn dataField="@id" width="125" />
   <mx:AdvancedDataGridColumn dataField="@name"  />
   <mx:AdvancedDataGridColumn dataField="id" width="125" />
   <mx:AdvancedDataGridColumn dataField="name" />
   <mx:AdvancedDataGridColumn dataField="value" />
</mx:columns>
</mx:AdvancedDataGrid>




Data From the Debugger:


gc      mx.collections.GroupingCollection (@7328a2f1)   
        [inherited]     
        grouping        mx.collections.Grouping (@73356421)     
        optimizeSummaries       false   
        source  mx.collections.XMLListCollection (@733d5d41)    
                [inherited]     
                [0]     XML     
                [1]     XML     
                [2]     XML     
                [3]     XML     








records mx.collections.XMLListCollection (@733d5d41)    
        [inherited]     
        [0]     XML     
                <record id="180013" name="SHC VIEW ONLY CLINICAL">      
                        <item id="11" name="">  
                                <value> "500307"        
                        <item id="130" name=""> 
                        <item id="3060" name="">        
                        <item id="70" name="">  
                        <item id="71" name="">  
                        <item id="17" name="">  
                        <item id="20000" name="">       
                        <item id="30" name="">  
                        <item id="65" name="">  
                        <item id="50" name="">  
                        <item id="120" name=""> 
                        <item id="40" name="">  
                        <item id="75" name="">  
                        <item id="9" name="">   
                        <item id="12" name="">  
                        <item id="20" name="">  
                        <item id="60" name="">  
                        <item id="45" name="">  
                        <item id="10" name="">  
        [1]     XML     
        [2]     XML     
        [3]     XML     
        [4]     XML     
        source  XMLList (@734c0731)     






[0]     mx.collections.GroupingField (@734fc351)        
        caseInsensitive false   
        compareFunction null    
        descending      false   
        groupingFunction        null    
        groupingObjectFunction  null    
        name    "record"        
        numeric false   
        summaries       null    





References I have been reading
http://livedocs.adobe.com/flex/3/html/help.html?content=about_dataproviders_2.html
http://flexpearls.blogspot.com/2008/05/grouping-xml-data-using.html
http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_08.html




Thank you for your help ! 

-Brian 



Reply via email to