AdvancedDataGrid itemrenderer gripes

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"
        initialize="gc.refresh();"
        styleName="enhancedChargesGrid"
        verticalGridLineColor="#ffffff"  headerHeight="20">
        <mx:dataProvider>
            <mx:GroupingCollection id="gc" source="{adgChargesList}" childrenField="undefined">
                <mx:grouping>
                    <mx:Grouping>
                        <mx:GroupingField name="ServiceType" descending="true" id="st">
                            <mx:summaries>
                              <mx:SummaryRow summaryPlacement="group">
                                <mx:fields>
                                    <mx:SummaryField dataField="Charges"
                                        label="Charges" operation="SUM"/>
                                    <mx:SummaryField dataField="Accounts"
                                        label="Accounts" operation="SUM"/>
                                </mx:fields>
                              </mx:SummaryRow>
                            </mx:summaries>
                        </mx:GroupingField>
                        <mx:GroupingField name="Charge" descending="true" >
                            <mx:summaries>
                              <mx:SummaryRow summaryPlacement="group">
                                <mx:fields>
                                    <mx:SummaryField dataField="Charges"
                                        label="Charges" operation="SUM"/>
                                       <mx:SummaryField dataField="Accounts"
                                        label="Accounts" operation="SUM"/>
                                </mx:fields>
                              </mx:SummaryRow>
                            </mx:summaries>
                        </mx:GroupingField>
                    </mx:Grouping>
                </mx:grouping>
            </mx:GroupingCollection>
        </mx:dataProvider> 
        <mx:columns>
            <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}"/>
        </mx:columns>
          <mx:rendererProviders>
             <mx:AdvancedDataGridRendererProvider
                column="{cgeCol}"
                depth="1"
                columnSpan="1"
                renderer="renderers.adgRenderer"/>
          </mx:rendererProviders>
    </mx:AdvancedDataGrid>
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:
<charges>
  <item>
    <ServiceType>Total Subscriber Charges</ServiceType>
    <Charge>Usage Charges</Charge>
    <ChargeType>Voice - Cellular</ChargeType>
    <Accounts>9</Accounts>
    <Usage>55184</Usage>
    <Units>mins</Units>
    <UnitCharges>0.072</UnitCharges>
    <Charges>3950.08</Charges>
  </item>
</charges>
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.
Jack

Hi,
I think inside your itemrenderer you can override the updateDisplayList method and make "lblExercitii" label's includeInLayout and visible property values to false if the data.id_exercitii is null. If data.id_exercitii is not null make "lblExercitii" label's includeInLayout and visible property values to true.

Similar Messages

  • AdvancedDataGrid ItemRenderer Issue using code behind method

    I have been trying to get an itemrenderer to correctly work in an advanveddatagrid. I've used several itemrenderers in the past so this is pretty basic. I haven't however tried to attach to a grid that is inside a page using the code behind method. My issue is that the grid breaks if I try to put more than one visual component on the renderer. See the images below:
    Here is an example with a plain canvas itemrenderer:
    As you can see the scroll bar appears and everything looks normal.
    Here is the behavior if I add a label inside this component:
    The scroll bar disappears and I'm unable to close the itemrenderer correctly.
    Has anyone come across this issue before? Thanks for any help on this one!

    I can't post all of the code since it's on a much larger page but hopefully this gives you an idea:
    <custom:ClientPlans xmlns:mx="http://www.adobe.com/2006/mxml" width="920" height="550" xmlns:flexlib="http://code.google.com/p/flexlib/"
            fontFamily="HelveticaNeue Condensed" fontSize="11"
            xmlns:components="components.*"
            disabledColor="#FFFFFF"
            themeColor="#FFFFFF"
            horizontalScrollPolicy="off"
            verticalScrollPolicy="off" 
            backgroundColor="#ffffff"
            cornerRadius="10"
            borderStyle="solid"
            borderThickness="0"
            horizontalCenter="0" verticalCenter="0" color="#808080">
    <mx:AdvancedDataGrid id="adgPlans" width="100%" height="497" selectionMode="singleRow" editable="false"
                            color="#000000" fontSize="14" selectable="true"
                            liveScrolling="false"
                            showHeaders="false" variableRowHeight="true"
                            disclosureOpenIcon="@Embed(source='/images/gridMinus.png')"
                            disclosureClosedIcon="@Embed(source='/images/gridPlus.png')"
                            folderOpenIcon="@Embed(source='/images/folderOpenIcon.png')"
                            folderClosedIcon="@Embed(source='/images/folderclosedIcon.png')" borderThickness="1" borderStyle="solid">
                              <mx:dataProvider>
                                     <mx:GroupingCollection id="gcGroup">
                                            <mx:grouping>
                                                <mx:Grouping>
                                                    <mx:GroupingField name="ClientName"/>
                                                </mx:Grouping>
                                            </mx:grouping>
                                     </mx:GroupingCollection>
                              </mx:dataProvider>       
                            <mx:columns>
                                <mx:AdvancedDataGridColumn id="clientNameColumn" dataField="clientName" headerText="Client" sortable="true" width="200" />
                            </mx:columns>
                            <mx:rendererProviders>
                                <mx:AdvancedDataGridRendererProvider
                                    column="{clientNameColumn}"
                                    columnSpan="0"
                                    depth="2"
                                    renderer="components.subcomponents.clientRenderer3"/>
                            </mx:rendererProviders>
                        </mx:AdvancedDataGrid>
    </custom:ClientPlans>
    Code-Behind:
    // ActionScript file
    package com.name
            import mx.controls.AdvancedDataGrid;
        public class ClientPlans extends Canvas
            public var adgPlans:AdvancedDataGrid;
         public function ClientPlans ()
                super();
                this.addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
            private function creationCompleteHandler (event:FlexEvent):void
                  trace("cc");
    Item Renderer:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
        width="100%" height="150" borderStyle="solid" borderThickness="2" borderColor="#56ACD1" cornerRadius="8"
        fontFamily="HelveticaNeue Condensed" color="#000000" backgroundColor="#FFFFFF" backgroundAlpha="1.0">
        <mx:Label text="Hello!?"/>
    </mx:Canvas>

  • How to get AdvancedDataGrid ItemRenderer for hierarchal column to work

    I have an advanced datagrid with 5 columns one of which is a
    hierarchal (tree). This datagrid is populated by the following:
    MyAdvancedDataGrid.dataProvider = new
    HierarchicalData(MyXMLListCollection);
    The first column is the tree and im trying to do a item
    renderer on it in actionscript... I have the following code:
    MyTreeColumn.itemRenderer = new ClassFactory(MyRenderer);
    In order to get the icon and label to show up i need to
    extend AdvancedDataGridGroupItemRenderer as such:
    MyRenderer extends AdvancedDataGridGroupItemRenderer
    This has one problem... the updateDisplayList function only
    gets fired for the children not the root rows... So if you set the
    this.icon.visible = false... the icon will show up on the root rows
    but the most bottom children rows the icon will become invisible...
    Now ... if i extend the class with
    AdvancedDataGridItemRenderer then the tree functionality gets
    overwritten and it doesn't function the way that I need it to..
    Ultimately I'm trying to shift the default label over so I can add
    another icon to the right of the the default icon so the user can
    click on it... Any help from anyone would be greatly
    appreciated...

    var column:AdvancedDataGridColumn;
    column = new AdvancedDataGridColumn("HeaderName");
    column.width = 10;
    column.dataField = "@label";
    column.itemRenderer = new ClassFactory(MyItemRenderer);
    MyAdvancedDataGrid.columns = [column];
    code for MyItemRenderer:
    package {
    import mx.controls.dataGridClasses.DataGridListData;
    import mx.controls.listClasses.BaseListData;
    import mx.controls.listClasses.IDropInListItemRenderer;
    import mx.controls.listClasses.IListItemRenderer;
    import mx.core.UIComponent;
    public class MyItemRenderer extends UIComponent implements
    IDropInListItemRenderer, IListItemRenderer {
    //class variables
    private var _ListData:DataGridListData = null;
    private var _data:Object = null;
    public function PE_BaseRenderer() {
    super();
    public function get listData():BaseListData {
    return _ListData;
    public function set listData(value:BaseListData):void {
    _ListData = value as DataGridListData;
    public function get data():Object {
    return _data;
    public function set data(value:Object):void {
    _data = value;
    invalidateProperties ();
    override protected function createChildren():void {
    super.createChildren();
    //create you children here
    } //end of class declaration
    } //end of package declaration
    Within this renderer you can create whatever type of children
    you want for the datagrid column

  • Flex AdvancedDataGrid - ColumnOrder With Formatter and ItemRenderer Question For Experts

    I have a advanceddatagrid that has around 15 columns. Some are string,
    some are numbers. I have shown 4 columns below.
    The number columns have formatting done for zero precision and 2
    digits precision.  The itemRenderer is just to show Blue Color if the
    number is +ve and Red Color if the number is -ve.
    It looks something like below
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="Name" textAlign"left"/>
    <mx:AdvancedDataGridColumn dataField="Time" textAlign="right"/>
    <mx:AdvancedDataGridColumn dataField="Score" textAlign="right"  formatter="{zeroPrecisionFormatter}" sortable="true"   itemRenderer="ColorRenderer" />
    <mx:AdvancedDataGridColumn dataField="Average" textAlign="right" headerWordWrap="true" formatter="{twoPrecisionFormatter}" itemRenderer="ColorRenderer" />
    I am trying to save the users setting of column order  when he closes
    the application and reload with the same order when the user opens the
    applications. I am using SharedObjects and below is the code.
    for(var i:int=0; i< adgrid.columns.length;i++){
         var columnObject:Object = new Object();
         columnObject.columnDataField = adgrid.columns[i].dataField as String;
         columnObject.columnHeader =adgrid.columns[i].headerText as String;
         columnObject.width = adgrid.columns[i].width;
         columnArray.push(columnObject);
    and then I save the columnArray to SharedObject.
    I retrive them using the below code
    for(var i:int=0;i<columnArray.length;i++){ 
        adgrid.columns[i].dataField =columnArray[i].columnDataField;
        adgrid.columns[i].headerText =columnArray[i].columnHeader;
        adgrid.columns[i].width = columnArray[i].width;
    How can I save and reload the Formatter and ItemRenderer data .
    I am having trouble saving the formatter and itemrenderer and
    reloading it again.
    I would really appreciate if you can shown the code.
    How can I reshuffle the columns but can preserve all the properties of it to though  sharedobject and recover it again

    I would bypass the DataGrid all together.  Using the DataGrid , you have to mess with itemrenderers and indexes ... not
    very fun when one can avoid it.  Instead , I would do my calculations off of the dataprovider.  Then it becomes an elementary exercise of a for-loop and [Bindable] values.

  • ItemRenderer in AdvancedDataGrid

    I am not sure how to add an itemRenderer in an
    AdvancedDataGrid. The advancedDataGrid is populated using an
    external xml as shown below. Because I store the data with xml
    attribute, I am not sure how to work this. My goal is to use
    different icons for values 1 through 5. Can someone help?
    The following link is my advancedDataGrid application
    application

    "irislpc" <[email protected]> wrote in
    message
    news:ghc026$lu2$[email protected]..
    >I am not sure how to add an itemRenderer in an
    AdvancedDataGrid. The
    > advancedDataGrid is populated using an external xml as
    shown below.
    > Because I
    > store the data with xml attribute, I am not sure how to
    work this. My goal
    > is
    > to use different icons for values 1 through 5. Can
    someone help?
    Why not just use an iconFunction?

  • AdvancedDataGrid as a itemRenderer

    I am trying to make a list menu using advanceddatagrid. What
    I would like is a 1 column item with a tree control. I have created
    that. Then when you pull it down it pulls in a data grid below it.
    I have this mxml code:
    <mx:Canvas width="300" height="800" id="outerCanvas" >
    <mx:AdvancedDataGrid rowCount="0" width="100%"
    height="100%" id="location_list" variableRowHeight="true"
    dataProvider="{argumentData}" change="handleClick(event);"
    folderClosedIcon="{null}"
    folderOpenIcon="{null}"
    defaultLeafIcon="{null}" >
    <mx:columns>
    <mx:AdvancedDataGridColumn headerText="" width="20"/>
    <mx:AdvancedDataGridColumn dataField="@label"
    headerText=""/>
    <!--<mx:AdvancedDataGridColumn dataField="key"
    headerText="Key" width="30"/>
    <mx:AdvancedDataGridColumn dataField="name" id="b_name"
    headerText="Building Name"/>-->
    </mx:columns>
    <mx:rendererProviders>
    <mx:AdvancedDataGridRendererProvider
    depth="2"
    columnIndex="0"
    columnSpan="0"
    rowSpan="0"
    renderer="buildingLoc"/>
    </mx:rendererProviders>
    </mx:AdvancedDataGrid>
    </mx:Canvas>
    </mx:Application>
    and this is my renderer
    <mx:DataGrid xmlns="*" xmlns:mx="
    http://www.adobe.com/2006/mxml"
    showHeaders="false">
    <mx:Script>
    <![CDATA[
    override public function set data(value:Object):void
    dataProvider = value;
    ]]>
    </mx:Script>
    <mx:columns>
    <mx:DataGridColumn dataField="key" headerText="Key" />
    <mx:DataGridColumn dataField="name" headerText="Building
    Name" />
    </mx:columns>
    </mx:DataGrid>
    what seems to happen is it creates a separate datagrid for
    each element of the data set. How do I nest the datagrid in so it
    just displays as a list?
    Here is my compiles swf so you can see what is going on:
    http://bradrice.com/test/testList.swf
    and my xml is here:
    http://bradrice.com/test/assets/buildingList.xml
    any help would be appreciated. I have banged my head on this
    one.

    I think I figured out how to create my menu from the
    advanceddatagrid using an itemRenderer. Here it is working:
    http://bradrice.com/test/testList2.swf
    I changed the renderer to this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox paddingLeft="2" xmlns:mx="
    http://www.adobe.com/2006/mxml"
    >
    <mx:Script>
    <![CDATA[
    override public function set data( value:Object ) : void {
    super.data = value;
    ]]>
    </mx:Script>
    <mx:Label text="{data.key}" width="30" />
    <mx:Text width="100%" text="{data.name}" />
    </mx:HBox>
    Now, one thing I would like to do is somehow remove the
    change event on just the top level list items. Right now if you
    click one of the items you will get some data from the item.
    However the top level items don't have the data and I don't want
    the event to fire when you click them. Any thoughts anybody?

  • ItemRenderer of AdvancedDataGrid

    Default ItemRenderer of AdvancedDataGrid (ADG) extends
    UITextField ( that is not a UIComponent). But I am using a
    UIComponent (that encapsulate UITextField) as Itemrenderer of ADG.
    It made my application noticeably slow. I don't know why.
    Does anybody know what is the problem with it and whats its
    soltution?
    Regards

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    mx.controls.DataGrid (Flex 3):
    Called by Flex when a UIComponent object is added to or
    removed from a parent. ..... Typically overridden by components
    containing UITextField objects,
    Link:
    http://livedocs.adobe.com/flex/3/langref/mx/controls/DataGrid.html
    Adobe - Flex General Discussion:
    Apr 21, 2008 ... What is the best way to adjust the row
    height from the UIComponent itemRenderer such that it fits into the
    cell? Print this message
    Link:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&enterthread=y&forum id=60&threadid=1346319
    Alexs Flex Closet: More Thinking About Item Renderers:
    Apr 6, 2007 ... I would take a UIComponent and add children
    Image and UITextField. You can look at the Flex framework source
    for ListItemRenderer for
    Link:
    http://blogs.adobe.com/aharui/2007/04/more_thinking_about_item_rende.html
    mx.printing.PrintDataGrid (Flex 2.0.1 Language Reference):
    Draws the background of the headers into the given
    UIComponent. DataGrid. Inherited ... Typically overridden by
    components containing UITextField objects,
    Link:
    http://livedocs.adobe.com/flex/201/langref/mx/printing/PrintDataGrid.html
    Alexs Flex Closet: Thinking About Item Renderers:
    Mar 29, 2007 ... Subclass of DataGrid that dispatches a
    custom event. ...... How do you reference it from within your
    itemRenderer component.
    Link:
    http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

  • How to hide itemRenderers in the Grouped rows of an AdvancedDataGrid?

    I am using an AdvancedDataGrid and showing a comboBox as the itemRenderer and also the editRenderer. However I am seeing the combobox in the grouped rows also. Below is the code I am using and also attached the screenshot of the app. Please help.
    TestAdvGridGrpRen.mxml
    ===================
    <?xml version="1.0"?>
    <!-- dpcontrols/adg/SummaryGroupADGCustomSummary.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
                import mx.collections.IViewCursor;   
                import mx.collections.SummaryObject;
    [Bindable]
    private var dpFlat:ArrayCollection = new ArrayCollection([
      {Region:"Southwest", Territory:"Arizona",
          Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000},
      {Region:"Southwest", Territory:"Arizona",
          Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000},
      {Region:"Southwest", Territory:"Central California",
          Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000},
      {Region:"Southwest", Territory:"Nevada",
          Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000},
      {Region:"Southwest", Territory:"Northern California",
          Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000},
      {Region:"Southwest", Territory:"Northern California",
          Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000},
      {Region:"Southwest", Territory:"Southern California",
          Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000},
      {Region:"Southwest", Territory:"Southern California",
          Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000}
                // Callback function to create
                // the SummaryObject used to hold the summary data.
                private function summObjFunc():SummaryObject {
                    // Define the object containing the summary data.
                    var obj:SummaryObject = new SummaryObject();
                    // Add a field containing a value for the Territory_Rep column.
                    obj.Territory_Rep = "Alternating Reps";
                    return obj;
                // Callback function to summarizes
                // every other row of the Actual sales revenue for the territory.
                private function summFunc(cursor:IViewCursor, dataField:String,
                    operation:String):Number {
                    var oddCount:Number = 0;
                    var count:int = 1;
                    while (!cursor.afterLast)
                        if (count % 2 != 0)
                            oddCount += cursor.current["Actual"];
                        cursor.moveNext();
                        count++;
                    return oddCount;
          ]]>
        </mx:Script>
        <mx:AdvancedDataGrid id="myADG"
            width="100%" height="100%"
            initialize="gc.refresh();">      
            <mx:dataProvider>
                <mx:GroupingCollection id="gc" source="{dpFlat}">
                    <mx:Grouping>
                       <mx:GroupingField name="Region"/>
                       <mx:GroupingField name="Territory">
                          <mx:summaries>
                             <mx:SummaryRow summaryObjectFunction="summObjFunc"
                                summaryPlacement="first">
                                <mx:fields>
                                   <mx:SummaryField dataField="Actual" summaryFunction="summFunc"/>
                                </mx:fields>
                             </mx:SummaryRow>
                          </mx:summaries>
                       </mx:GroupingField>
                    </mx:Grouping>
                </mx:GroupingCollection>
            </mx:dataProvider>      
            <mx:columns>
                <mx:AdvancedDataGridColumn dataField="Region"/>
                <mx:AdvancedDataGridColumn dataField="Territory_Rep"
                    headerText="Territory Rep"/>
                <mx:AdvancedDataGridColumn headerText="Actual" dataField="Actual"
                rendererIsEditor="true"
                itemRenderer="TestStatusTypeEditor"
                editorDataField="type"/>
                <mx:AdvancedDataGridColumn dataField="Estimate"/>
            </mx:columns>
       </mx:AdvancedDataGrid>
    </mx:Application>
    TestStatusTypeEditor.mxml
    ====================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="OnInit()" >
    <!-- This is the content of the ComboBox.
    <mx:dataProvider>
    <mx:Object label="Cog" />
    <mx:Object label="Sproket" />
    </mx:dataProvider>
    -->
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
            [Bindable]
            public var cards:ArrayCollection = new ArrayCollection(
                [ {label:"38865", data:1},
                  {label:"29885", data:2},
                  {label:"29134", data:3},
                  {label:"52888", data:4},
                  {label:"38805", data:5},
                  {label:"55498", data:6},
                  {label:"44985", data:7},
                  {label:"44913", data:8}]);
    private function OnInit():void
    dataProvider = cards;
    * This override of set data compares the data.label against the label property
    * of each item in the dataProvider (above). This code is written a bit more
    * generically than necessary, but it would allow you to have a long list
    * in the dataProvider and not have to change this code.
    override public function set data(value:Object):void
    super.data = value;
    var list:ArrayCollection = dataProvider as ArrayCollection;
    for(var i:int=0; i < list.length; i++)
    if( String(value.statusName) == list[i].label ) {
    selectedIndex = i;
    * This getter is the one identified as the editorDataField in the list for
    * the itemEditor.
    public function get type() : String
    if( selectedItem ) {
    return selectedItem.label;
    else {
    return null;
    ]]>
    </mx:Script>
    </mx:ComboBox>

    Solved this issue by using mx:rendererProviders element for my AdvancedGrid. Using the depth parameter gives me the ability to hide the itemRenderer for the Grouped rows.
        <mx:AdvancedDataGrid id="myADG"
            width="100%" height="100%"
            initialize="gc.refresh();">       
            <mx:dataProvider>
                <mx:GroupingCollection id="gc" source="{dpFlat}">
                    <mx:Grouping>
                       <mx:GroupingField name="Region"/>
                       <mx:GroupingField name="Territory">
                          <mx:summaries>
                             <mx:SummaryRow summaryObjectFunction="summObjFunc"
                                summaryPlacement="first">
                                <mx:fields>
                                   <mx:SummaryField dataField="Actual" summaryFunction="summFunc"/>
                                </mx:fields>
                             </mx:SummaryRow>
                          </mx:summaries>
                       </mx:GroupingField>
                    </mx:Grouping>
                </mx:GroupingCollection>
            </mx:dataProvider>       
            <mx:columns>
                <mx:AdvancedDataGridColumn dataField="Region"/>
                <mx:AdvancedDataGridColumn dataField="Territory_Rep"
                    headerText="Territory Rep"/>
                <mx:AdvancedDataGridColumn headerText="Actual" dataField="Actual"
                rendererIsEditor="true"
                editorDataField="type"/>
                <mx:AdvancedDataGridColumn dataField="Estimate"/>
            </mx:columns>
    <mx:rendererProviders>
        <mx:AdvancedDataGridRendererProvider
            columnIndex="2"
            columnSpan="1"
            depth="3"
            renderer="TestStatusTypeEditor"/>
    </mx:rendererProviders>
       </mx:AdvancedDataGrid>

  • Problem in accessing the itemRenderer dynamically

    Hi,
         In my application i am using two AdvanceddataGrids. i am showing one datagrid at a time based on the user selection. I have provided the buttons to switch between the grids. These two datagrids are getting the data from XML. By default the data will be available for the first datagrid in XML. Once the user selects the second grid, i am using the HTTPService to fetch the data for that particular grid. (This HTTPService will pass this grid's id as QueryString to the same XML page, and the .Net will read these parameters to fetch the required data from the DB and will print the data in the XML format in the same page).
         Here, for the first datagrid, i have used the itemRenderer to show some images (in the datagrid) based on the data available in XML. And i have followed the same for the second grid also.
         But the probelm is, whenever the application starts runnning (on Creation complete of the application), i am not able to view the images for the first datagrid, since the data for the second datagrid is not available (i have defined the itemRenderer for the second dataGrid based on XML data).
         I have stored the itemRenderers for each datagrid as a separate component. Is there any way to add this itemRenderer component during the run time. (While the user clicks the button to view the second datagrid)?
         "(Second datagrid's) coloumnid.itemRenderer = mycomponent.mxml"  (I have tried this code to access during selection of second datagrid. But it didn't work).
         Could someone help me on this?

    When you say:
    But the probelm is, whenever the application starts runnning (on Creation complete of the application), i am not able to view the images for the first datagrid, since the data for the second datagrid is not available (i have defined the itemRenderer for the second dataGrid based on XML data).
    I don't understand. Why would the images in the first datagrid not be availabe because the data for the second grid is not available?
    If certain data needs to be loaded for creationComplete, then ensure it is loaded.
    Perhaps you can clarify these points as your scenario is not clear.

  • Using a canvas as an itemrenderer - how to access the datafield?

    Yes... another ItemRenderer related question...
    So I have this advancedDataGrid of which I dynamically
    generate the columns in actionscript. Each of these columns get
    their own datafield.
    This code works well, since all the data displays nicely
    where I want it to be.
    However, in the columns there are numbers from like 0 to 10,
    these are put there by the default itemrenderer by using the
    datafield. Instead of just displaying these numbers, I'd like to
    use a canvas as an itemrenderer to draw something in the box based
    on the value of the number. So all I need to access in my Canvas is
    the value that is parsed by the datafield.
    I thought to do so by overriding public function set
    data(value:Object):void
    But what does value contain? I tried doing something with it
    but I keep getting errors. Does value just contain the entire
    dataProvider? Or is there a way to acces just the number that would
    be put on that position in the grid if I wouldn't be using a custom
    itemrenderer at all?
    I've searched tons of blogs but haven't found the exact
    answer to my question yet.
    Many thanks in advance.

    "Lvw2000" <[email protected]> wrote in
    message
    news:gnucks$8kh$[email protected]..
    > Yes... another ItemRenderer related question...
    >
    > So I have this advancedDataGrid of which I dynamically
    generate the
    > columns in
    > actionscript. Each of these columns get their own
    datafield.
    >
    > This code works well, since all the data displays nicely
    where I want it
    > to be.
    >
    > However, in the columns there are numbers from like 0 to
    10, these are put
    > there by the default itemrenderer by using the
    datafield. Instead of just
    > displaying these numbers, I'd like to use a canvas as an
    itemrenderer to
    > draw
    > something in the box based on the value of the number.
    So all I need to
    > access
    > in my Canvas is the value that is parsed by the
    datafield.
    >
    > I thought to do so by overriding public function set
    > data(value:Object):void
    >
    > But what does value contain?
    It contains the information needed for the entire row. Just
    put a break
    point in the code in your override function and then run the
    application in
    debug mode. Use the variables window to inspect the value.
    > I tried doing something with it but I keep
    > getting errors.
    Are the errors related to the value or are they related to
    something else,
    such as trying to set properties on subcomponents that have
    not been
    instatiated yet.
    > Does value just contain the entire dataProvider? Or is
    there a
    > way to acces just the number that would be put on that
    position in the
    > grid if
    > I wouldn't be using a custom itemrenderer at all?
    Look at implementing IDropInListItemRenderer and then look at
    listData.label.
    HTH;
    Amy

  • How to add a button to the grouped data in an AdvancedDataGrid?

    Hi,
    Can anyone please suggest how to add a button to the grouped data in the AdvancedDataGrid?
    I have tried extending the AdvancedDataGridGroupItemRenderer and using it as the groupItemRenderer but its not reflecting.
    For the leaf node the itemRenderer property works just fine.
    Please help!

    HI ,
    I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
    I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list  but still I am unable to get any additional button on the output ALV popup.
    Please help.
    Regards,
    Kavya.

  • Dynamic Hyperlinks in DataGrid/AdvancedDataGrid

    Forgive me, but when the web was build around hyperlinked text, it should be easier to create hyperlinks in a Rich INTERNET Application.
    Ok - enough griping. I do have a legit question:
    For historical reasons, I have to construct hyperlinks from a number of parameters passed in the URL (aka GET params). Since I write reporting systems, those hyperlinks usually have to appear in a table of some sort: a DataGrid or AdvancedDataGrid.
    My typical code looks something like this:
    <mx:Application blah=blah>
         <mx:Script>
              <![CDATA[
              ]]>
         </mx:Script>
         <mx:HTTPService id="getStuff" method="get" url="http://www.example.com/getData.php" result="processServerData(event)"/>
         <mx:AdvancedDataGrid blah=blah>
              <mx:columns>
                   <mx:AdvancedDataGridColumn blah=blah itemRenderer="ADGcustomItemRenderer"/>
              </mx:columns>
         </mx:AdvancedDataGrid>
    </mx:Application>

    OK, I didn't mean to post that yet. Why can't I edit my post?
    Anyways...
    <mx:Application blah=blah>
         <mx:Script>
              <![CDATA[
                   import a.bunch.of.stuff
                   protected function onInitialize():void {
                        getStuff.send();
              ]]>
         </mx:Script>
         <mx:HTTPService id="getStuff" method="get" url="http://www.example.com/getData.php" result="processServerData(event)"/>
         <mx:AdvancedDataGrid blah=blah>
              <mx:columns>
                   <mx:AdvancedDataGridColumn blah=blah dataField="dataFieldName" itemRenderer="ADGcustomItemRenderer"/>
              </mx:columns>
         </mx:AdvancedDataGrid>
    </mx:Application>
    ADGcustomItemRenderer.mxml
    <mx:Canvas blah=blah>
         <mx:Script>
              <![CDATA[
                   import mx.controls.dataGridClasses.DataGridColumn;
                [Bindable] protected var myURL :String;
                override public function set data(value:Object):void {
                        myURL = '<a href="http://www.example.com/dosomething.php?dept_num=00000&vendor='+value['dataFieldName']+'" target="_blank">'+value['VendorName']+'</a>';
              ]]>
         </mx:Script>
         <mx:Text htmlText="{myURLl}" height="100%" width="100%" />
    </mx:Canvas>
    Notice the dept_num? I need to pass that data to the itemRender, since it can change from page to page (though not row by row) in addition to the column-specific data passed via the "value" object. How can I access that data from the custom itemRenderer?
    Thanks

  • Itemrenderer with images doesn't work  correctly if variableRowHeight="true"?

    Hi all,
    I have a problem to use itemrenderer in my project:
    I have to show some images in one of my DataGridColumn:
    <mx:DataGridColumn id="datasetcolumn" headerText="DataSet"
    dataField="dataSetList"
    width="240"itemRenderer="DataSetRenderer"/>
    The dataSetList is an arraycollection of images;
    I use Tile as the itemrederer, My DataSetRenderer is:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Tile xmlns:mx="
    http://www.adobe.com/2006/mxml"
    horizontalScrollPolicy="off" width="90%" height="100%" >
    <mx:Metadata>
    [Event(name="showCaddwgNOVWebDataset",
    type="flash.events.Event")]
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import mx.controls.Image;
    import mx.controls.AdvancedDataGrid;
    import mx.core.IFlexDisplayObject;
    import CETEvent.*;
    import view.util.*;
    import mx.collections.ArrayCollection;
    [Bindable] public var myarr:ArrayCollection = new
    ArrayCollection();
    override public function set data(value:Object):void{
    super.data = value;
    myarr = value.datasetList;
    this.myrep.dataProvider = myarr as ArrayCollection;
    ]]>
    </mx:Script>
    <mx:Repeater id="myrep" visible="true" >
    <mx:Label text="{myrep.currentItem.itIconName}"/>
    <mx:Image id="datasetImg"
    source="{myrep.currentItem.itIconName}"
    useHandCursor="true" buttonMode="true" mouseChildren="false"
    toolTip="{myrep.currentItem.itName}"/>
    </mx:Repeater>
    </mx:Tile>
    The problem is:
    Whenever you change the column size or scroll down the
    datagrid,
    the images will be added again.
    if the datasetlist is changed the old images doesn't clean up
    and
    all the images messed up
    Any suggestion is appretiated!
    Thanks in advance

    I loved Ben's suggestion because it promised to be a low-effort workaround, but, alas, I get the same problem: "lvlib is already loaded from this path...".
    I tried Olivia's workaround for CAR 124214. It worked great for the simple lvproj that is posted above. (Hooray!) It didn't work so well in my real project, that has about 30 lvlibs and lvclasses. About 3/4 of the way through the save, I got a compiler error and LabView crashed. (Boo!) I submitted the crash log on this, but it's hard to imagine how anyone in R&D could make any progress debugging this without the source code. (And I can't submit the source because I can't export a copy of it!)
    Anyway, thank you very much Ben and Olivia for your suggestions. I have lvclasses embedded in lvlibs (primarily for organizational reasons) and since LabView tanked while saving one of those, perhaps the workaround doesn't work in this case. I may try again after removing the lvclasses from the lvlibs so that the hierarchy is flatter.
    -Rob 

  • Add Custom Right click menu on editable AdvancedDataGrid

    Hi,
    I have an AdvancedDataGrid whose editable property is set to true and selectionmode is multipleCells.
    Is it possible to display custom right click menu when i right click on any cell? Am getting only the
    default menu items (Cut, Copy, Paste, Select All). Am using ContextMenu and ContextMenuItem class
    for creating the custom right click menu. The same code is working in Flex and not in AIR. Do we have
    to use NativeMenu in Adobe AIR? Please help. Attaching sample of my code.
    <mx:Script>
    <![CDATA[
    [Bindable] 
    private var cMenu:ContextMenu; 
    public function createContextMenu():void {
              cMenu =
    new ContextMenu();     cMenu.hideBuiltInItems();
         cMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelect);
         var cMenuItemCopy:ContextMenuItem = new ContextMenuItem("Copy Data");     cMenuItemCopy.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItemSelect_Copy);
         var cMenuItemPaste:ContextMenuItem = new ContextMenuItem("Paste Data");     cMenuItemPaste.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItemSelect_Paste);
         cMenu.customItems.push(cMenuItemCopy);     cMenu.customItems.push(cMenuItemPaste);
    this.contextMenu = cMenu;    
    private  
    function contextMenu_menuSelect(event:ContextMenuEvent):void { }
    private function contextMenuItemSelect_Copy(event:ContextMenuEvent):void {
         copy(event);
     private function contextMenuItemSelect_Paste(event:ContextMenuEvent):void {
         paste(event);
    ]]>
    </mx:Script><mx:AdvancedDataGrid  width="100%" height="72%" id="dProvider" creationComplete="init()"
          editable="true" itemEditBeginning="checkIfAllowed(event)" itemEditEnd="onEditEnd(event)"
          selectionMode="multipleCells" itemRenderer="renderer.ColorForDashBoard" contextMenu="{cMenu}"/ >

    I have same issue too. Can any one help
    Thanks

  • DataGrid ComboBox itemRenderer/editor not updating dataProvider properly

    I have a DataGrid with one column using a ComboBox as the itemRenderer. The column is editable but if you trace the dataProvider, the changes lag behind by one. So uncheck two row's ComboBox and the dataProvider only shows one row's data updated.
    Any ideas?

    Yep, its a CheckBox, too early in the morning.
    Another component (DataGrid) will be filtered depending on what rows in the ADG have their CheckBox checked, so leaving the row may be too late.
    Here is the code I have so far. In the itemEditEnd event handler I'm trying to set the field in the dataProvider manually, but it causes an infinite loop. preventDefault and stopImmediatePropagation don't help.
    ----- CheckBoxRenderer.mxml -----
    <?xml version="1.0"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.controls.CheckBox;
          [Bindable] public var newSelected:Boolean;
        ]]>
      </mx:Script>
      <mx:CheckBox id="selectedChbx" selected="{data.FLAG}"/>
    </mx:VBox>
    ----- mainapp.mxml -----
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.events.AdvancedDataGridEvent;
          import mx.collections.ArrayCollection;
          import mx.controls.CheckBox;
          [Bindable] private var transactions:ArrayCollection = new ArrayCollection([
            {orderID: "33725", theirOrderNumber: "10170", name: "Bob Smith", SKUs: "21", PICKS: "50", FLAG: "true"},
            {orderID: "33729", theirOrderNumber: "10172", name: "Mary Wilson", SKUs: "3", PICKS: "6", FLAG: "true"},
            {orderID: "33730", theirOrderNumber: "10176", name: "Fred Carson", SKUs: "1", PICKS: "2", FLAG: "true"},
            {orderID: "33731", theirOrderNumber: "10177", name: "Morten Hills", SKUs: "5", PICKS: "16", FLAG: "true"},
            {orderID: "33732", theirOrderNumber: "10178", name: "Bill Trundy", SKUs: "5", PICKS: "34", FLAG: "true"},
            {orderID: "33734", theirOrderNumber: "10179", name: "Ocean Boat Supply", SKUs: "8", PICKS: "19", FLAG: "true"},
            {orderID: "33736", theirOrderNumber: "10180", name: "Janet Aberdine", SKUs: "5", PICKS: "18", FLAG: "true"},
            {orderID: "33737", theirOrderNumber: "10181", name: "Kim Restine", SKUs: "2", PICKS: "6", FLAG: "true"},
            {orderID: "33738", theirOrderNumber: "10182", name: "Thomas Overby", SKUs: "5", PICKS: "12", FLAG: "true"}
          public function handleGridChanged(evt:AdvancedDataGridEvent):void{
            var newData:Boolean = CheckBoxRenderer(evt.currentTarget.itemEditorInstance).newSelected;
            trace(evt.rowIndex);
            var obj:Object = transactions.getItemAt(evt.rowIndex);
            trace("BEFORE: " + obj.FLAG);
            obj.FLAG = newData;
            trace("AFTER: " + obj.FLAG);
            transactions.setItemAt(obj, evt.rowIndex);
            return;
            evt.preventDefault();
            evt.stopImmediatePropagation();
    //        for each(var item:Object in transactions){
              //trace(item.FLAG);
        ]]>
      </mx:Script>
      <mx:Label fontSize="12" text="Bulk Print / Pull - Step 1"/>
      <mx:HBox>
        <mx:AdvancedDataGrid id="dgTransactions" dataProvider="{transactions}"
          fontSize="12" editable="true" sortableColumns="true" height="500"
          width="100%" itemEditEnd="handleGridChanged(event);">
            <mx:columns>
              <mx:AdvancedDataGridColumn dataField="orderID" headerText="WMSOID" width="100"
                editable="false" textAlign="center"/>
              <mx:AdvancedDataGridColumn dataField="theirOrderNumber" headerText="Order #"
                textAlign="center" width="130" editable="false"/>
              <mx:AdvancedDataGridColumn dataField="name" headerText="Customer"
                width="125" textAlign="left" editable="false"/>
              <mx:AdvancedDataGridColumn dataField="SKUs" headerText="SKU's"
                width="75" textAlign="right" editable="false"/>
              <mx:AdvancedDataGridColumn dataField="PICKS" headerText="Picks"
                width="75" textAlign="right" editable="false"/>    
              <mx:AdvancedDataGridColumn dataField="FLAG" headerText="I" width="20" textAlign="center"
                editable="true" rendererIsEditor="true" editorDataField="newSelected"
                itemRenderer="CheckBoxRenderer"/>
            </mx:columns>
        </mx:AdvancedDataGrid>
        <mx:DataGrid>
        </mx:DataGrid>
      </mx:HBox>
    </mx:Application>

Maybe you are looking for

  • Create new sequence for GoPro HD camera in CS5

    Can someone help me create a sequence in CS5 for a GoPro HD camera.  Which preset should I start with or what values should I change in the New Sequcne Window on the general tab? Here are the video details from a file using mediaplus.  Pixel Aspect R

  • Wireless losses connection when it goes into sleep.

    I'm using a Linksys Wrt54g router. Not a major problem since all you have to do is click the Airport icon and restart but why do it does it do this? My iMac flat panel doesn't do it.

  • Can I use the Bluetooth on my Centro to get on the internet.

    I have a refurbished palm Centro (so I wouldn't have to pay an extra $720 for the AT&T unlimited PDA data plan with the phone). It is replacing my old & dying Palm TX. One thing I loved about the TX was the wifi access. It was great to connect to my

  • AFAB transaction SAP 4.6 x ECC6

    Hello everybody In SAP 4.6 we have a substitution rule for AFAB transaction. It works well. Now, we are in Upgrade to ECC6. In SAP 4.6, the AFAB generates a RABUSCH folder to be execute in SM35. These rules were executed this moment. ( ( SYST-TCODE =

  • What can you do with bluetooth

    Is it possible to connect iphone to laptop and sync to the itunes. and send files to and from the iphone