0 Replies Latest reply on Jul 21, 2009 10:07 AM by jomelia

    AdvancedDataGrid itemrenderer gripes

    jomelia Level 1

      After a year of begging, I finally got my company to upgrade my FlexBuilder to the Professional edition for the Data Visualization goodies in there. So i've been playing around with the advancedDataGrid: is it me or does it seem a little half-baked? Don't want to go off topic before I get to my topic so I won't go into it now, but it hasn't been a smooth ride so far.


      Case in point, itemRenderers. I have a flat xml file displaying data as hierarchical using grouping, and applying a stylefunction to the tree with mixed results. For the top-level text item in the tree I want to add a link, so I thought, no problem, I'll add an itemrenderer with a linkbutton. When I apply it I lose everything in that column.  Here's my adg:


      <mx:AdvancedDataGrid id="myADG" styleFunction="myRowStyleFunction"
              width="100%" height="100%" sortExpertMode="true"
              verticalGridLineColor="#ffffff"  headerHeight="20">
                  <mx:GroupingCollection id="gc" source="{adgChargesList}" childrenField="undefined">
                              <mx:GroupingField name="ServiceType" descending="true" id="st">
                                    <mx:SummaryRow summaryPlacement="group">
                                          <mx:SummaryField dataField="Charges"
                                              label="Charges" operation="SUM"/>
                                          <mx:SummaryField dataField="Accounts"
                                              label="Accounts" operation="SUM"/>
                              <mx:GroupingField name="Charge" descending="true" >
                                    <mx:SummaryRow summaryPlacement="group">
                                          <mx:SummaryField dataField="Charges"
                                              label="Charges" operation="SUM"/>
                                             <mx:SummaryField dataField="Accounts"
                                              label="Accounts" operation="SUM"/>
                  <mx:AdvancedDataGridColumn id="cgeCol" dataField="ChargeType" styleFunction="myColStyleFunc"
                      headerText="" width="200" fontWeight="normal"/>
                  <mx:AdvancedDataGridColumn dataField="Accounts" headerText="Accounts" textAlign="right" fontWeight="bold"/>
                  <mx:AdvancedDataGridColumn dataField="Usage" headerText="Usage" textAlign="right"/>
                  <mx:AdvancedDataGridColumn dataField="Units" headerText="Units" textAlign="left"/>
                  <mx:AdvancedDataGridColumn dataField="UnitCharges" headerText="Unit Charges"/>
                  <mx:AdvancedDataGridColumn dataField="Charges" id="cges" headerText="Charges" fontWeight="bold" textAlign="right" formatter="{ccyFormatter}"/>






      My simple renderer:


      <mx:LinkButton xmlns:mx="http://www.adobe.com/2006/mxml"
           label="{data.ServiceType}" fontWeight="bold" fontSize="14"/>


      And a sample of my XML:


          <ServiceType>Total Subscriber Charges</ServiceType>
          <Charge>Usage Charges</Charge>
          <ChargeType>Voice - Cellular</ChargeType>



      This worked well in the regular datagrid. I suspect it has something to do  with the groupings but nothing I've goggled for has uncovered anything like that. Any help would be appreciated.